select - a misunderstanding
Hi,
I built a client server application (the first time):
TCP
client and server UNBLOCKING.
the application that I built was an indipendent project, and works just fine.
I now need to integrate it in my original workspace, in which computer A sends data for computer B that processes it and replies (big surprise)!!!
thus, I need to combine the client server code in the main loops of computes A, B.
Q1) how should I combine the server code in comp A, without causing the select() to block the application, as I need the server to do other things when no clients available?
Q1.1) should I solve the problem by creating a new thread that contains elect()? so it will not block computer A regular operation?
Q1.2) any other solutions?
Q2) just to understand the basic operation mechanism - when a client and server cooperate - are there different channels/ buffers from which client and server read/write data? i.e. does server have a buffer from which it is reading data and other one to which it is writing it? no chance for confusion?
thanks for your help
|