- #1
- 1,366
- 3
Hi,
I was wondering how to maintain constant communication (server send/client recv loop) using sockets in C/C++ (loop till client terminates connection). I can currently send/recv once bothways. But am unsure how to proceed to keep the communication going.
I'm guessing an infinite loop would be involved but would this also require threads. I tried an infinite loop but they only sent once.
Also for multiple clients is a server suppose to maintain all teh sockets in a list or tree?
Thanks
Neurocomp
I was wondering how to maintain constant communication (server send/client recv loop) using sockets in C/C++ (loop till client terminates connection). I can currently send/recv once bothways. But am unsure how to proceed to keep the communication going.
I'm guessing an infinite loop would be involved but would this also require threads. I tried an infinite loop but they only sent once.
Also for multiple clients is a server suppose to maintain all teh sockets in a list or tree?
Thanks
Neurocomp