0

how to connect multiple clients to a single server....???
i hv a server and a client connected to each othr. and sending and receving data. through tcp/ip proto. now i want to make connections with other clients also.

plz help me..

3
Contributors
6
Replies
7
Views
6 Years
Discussion Span
Last Post by Ancient Dragon
0

use the accept() function to accept the new socket, and for every socket start a thread, which will listen and send.

You can use poll() or select() to listen on multiple sockets, so you can even use one thread for all the sockets.

read about accept, poll and select, also thread.

0

hw can a client send message to another client through server??? any idea.....thanks..

0

client creates a packet of data that contains the ip address of the destination clinent and the message. Send that packet to server. Server receives the packet, checks the destination ip address and forwards it on the that client.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.