in reply to Sending Socket peer to peer
Is it possible to send peer to peer messages with sockets? If yes, how do I do it? What's my fault?
The magic of sockets is that it doesn't matter whether the other end is the same machine (loop-back address), a machine on the same LAN ("public" or "private" IP address) or a long way away ("public" IP address). So you are right to be puzzled...
What does matter is that (a) the client has a working address for the server, (b) the network in between is prepared to deliver packets between the two and (c) the server is prepared to accept connections from the client -- given the address the server is listening on, and the address the client is attempting to connect from.
I cannot tell whether you have an address problem here. You might be able to resolve that using good old-fashioned ping/traceroute. You can also poke at servers using telnet. In this day and age you should also consider whether some firewall is taking a dim view of the packets -- particularly at the server end. Also, the server itself may be "wrapped" against connections from outside the local network.
|
|---|