[Lazarus] One server and several clients [lNet]

John vd Waeter john at jvdw.nl
Fri Nov 14 18:26:54 CET 2008


ser wrote:
> Hi, I have a client-server program made with lNet and I have several 
> clients conected to the server.
> 
> The clients send petitions to the server and I want that the response 
> for the server is only for the client that has generated the petition.
> 
> For example I have three clients and one of them send "Hello" to the server.
> 
> When the server receibe "Hello" its responds "How are you?" but I want 
> that the server only send "How are you?" to the client whom it has sent 
> "Hello" and not for all the clients.
> 
> Thanks.
> 
> Best regards.

You probably are broadcasting (=sending to ip=0.0.0.0)?
Using UDP?
When reading "Hello" you should take note of the senders ip-address and 
port and then send the "How are you" to that ip/port.

I think it's called something like peerport and peerip... not sure, 
don't have lNet at hands...

gl,
John



More information about the Lazarus mailing list