Equal chat with the server

I am trying to make a peer-to-peer chat program. the scenario is much more complex, but I'll simplify it so I can get help where it needs to be.

as a summary:

A- Server

  • There is a server waiting for clients to connect, when a client connects, it will be kept waiting until the next client connects.
  • When the second client connects to the server, the server will return each client the ip and port of the other client, so both clients can talk to each other without server intervention.
  • Then the server goes back to 1

B- Client

  • the client will start a tcpClient connection to the server.
  • wait for server response.
  • client gets a custom object containing ip and port another client
  • start communicating with another client using the ip: port provided by the other client's server.

Question: Is this possible given the network security and firewall (default) configuration on the client machine?

The client may be behind a parry or a router.

The application will launch on the Internet or local network.

Note: I need help in C # to implement the client-side of the application to act as a server and listen on a port and receive connections, knowing that the port is not configured on a possible front-end router;

Are there alternative solutions? The basic idea is to leave the server out of the image after server step 2

+3


source to share





All Articles