so far I've been trying a single server+single client udp chat application where both server and client should be able to communicate with each other freely(as in regular chat applications). for this I used the select() function.what I initially got to know about this function is that it demultiplexex between more than one sockets. I haven't had much success in doing so.. My question is: am I using the right approach by using select? If no,then what approach should I use to acheive an asychronous udp chat application?
Tell me more
×
Programmers Stack Exchange is a question and answer site for
professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.
You can use threads. Whenever a client connect to the server you create a thread, this thread will call recv(), when a message is received you can verify its integrity, then the thread gice the hand to a message handler and can go back in recv() mode. |
|||||||||
|