Sockets, select and multiple clients.

Hello,
I am trying to implement the ALOHA protocol.
What I am trying to do is create a CHANNEL and few CLIENTS.
The CLIENTS are connecting to the channel and sending files to it.
The CHANNEL is supposed to receive packets from the CLIENTS, and each time
interval (few milliseconds) it should check for incoming packets.
If the CHANNEL receives 2 or more packets, it should return an ERROR PACKET
to all the clients that are connected to it.

My problem -
I can't really understand how to implement in the CHANNEL's side, the time interval checking.
If I open a thread for each client, they are not synchronized.
Do any of you have any idea of how to check for an incoming packet every time interval?

Thanks!
Check out select().
Topic archived. No new replies allowed.