I am new to socket programming and I need to clarify some things.
Do you need a server between two client communication? Let me explain what I mean:
Example 1:
- Client1: Server, I want to talk with a client2
- Server: No problem. Let's just wait until he sends the request to connect
- Client2: I'm here. I want to talk with client1.
- Server: Okay Client1 here is Client2 IP address. And for you Client2, here is
Client1 IP Address. You can now talk to each other without me.
Example 2:
- Client1: Server, please send client2 a message: "Hey client2. How are you?"
- Server: Okay no problem. Sending message to client2
- Client2: Server thanks for sending client1's message. Send him a reply: "Hey, I'm fine."
- Server: Sending message to client1..
So my question is: Do you need a server after you met two clients together to communicate between them? Or I'm on completely wrong track?
EDIT:
The purpose behind this is that I want to expand my very simple mobile game to become a multiplayer. Just for example, I want to show PACMAN2 on PACMAN1 mobile phone and vice versa.