I'm doing a chat desktop app with sockets and my intention is to create a peer-to-peer communication between clients. My question is this:
If I have all the IP addresses, can I connect simultaneously clients between them?
In my project every Client has both server sockets and sockets (client).
For example client_1 listens in the port 1001 for connections but at the same time can connect to other clients who have different IP-s and listen to different ports.
Now what I want to know, if someone with experience can tell it, is it possible to connect to some client and at the same time receive messages from others if I'm connected to one client but others are connected to me?
If Client_A listens to port 1001 but wants to chat with Client_B, than it connects himself to Client_B by specifying his IP and port; now, can at the same time Client_A recieve messages form other Clients who connects to his port?Is it possibile?
If someone can help me I can publish also my code; but I think is a logic problem I have to solve here.
Thank you very much.