D
D
Dima Zherebko2016-01-10 14:18:34
Java
Dima Zherebko, 2016-01-10 14:18:34

How to connect to server from client?

How to connect from the client to the server, if you do it all locally, then the code works, but if from another computer, then the
client cannot connect. It seems to me that the problem is in the IP address, although it seems to be correct, but if you ping it, it simply does not respond.
What could be the problem ?
client
server

Answer the question

In order to leave comments, you need to log in

4 answer(s)
K
Konstantin Berdnikov, 2016-01-10
@Toisen

You need a new ip for the server. The one you enter is issued to your computer by the router and is not visible "from the outside".

T
Timur, 2016-01-10
@timych

In order to correctly test the server from the outside, use the external IP of the gateway.
www.whatsmyip.org Here you can see.
If you are using a router, then you most likely need to set up port forwarding in it.
In your case, it will be necessary to forward requests from the outside to port 9800 to the computer on the home network on which the server is running.
www.dlink.ee/en/faq/68/275.html - example for d-link routers You
may still have to open a port for external requests in the oc firewall.
windows.microsoft.com/en-us/windows/open-port-wind... - instructions for Windows

A
Alexander, 2016-01-10
@cz_350

Ping is not an indicator. An IP address is like a house that has ( ports ) apartments. Try to attach from the client from the command line telnet 192.168.1.100 1234 , where 1234 is the port on the server. Also check your firewall.

S
sivabur, 2016-01-12
@sivabur

Buy an external ip for the server or run it on a dedicated server where a dedicated ip already exists.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question