in reply to Re: Multi threaded server [fork] in thread Multi threaded server [fork]
Unfortunatly i just got some higer priority work, so i'll have to stick to 'one client at a time' server for some time.
To answer your questions:
close conn. in parent: This would probbably work fine, since everything i do in the parent works as expected (have no time to test, though).
how do server and client communicate:
when server accepts the connection it forks off a child server, which, in a while loop, recieves one line of command and sends back the output. Last line of output is 'END\012\015', which indicates to the client stop reading. The client may then send a new command or 'SessionQuit\012\015', in which case the server closes the client connection and function returns.
|