Anyone tried this?
Please tell me If I do this harder than it should be done:
(assume the server and client communicates through a special protocol,
maybe some sort of authorization)
On every connect, you put the new clientfd in som client-struct and
add it to a linked list.
For everything that happens you have states, like STATE_GETPASSWORD - and
because you never know if a recv(8) gets you 8 bytes you have
to have a variable too in this struct telling me ho many bytes of the
password you have gotten.
I _have_ done this, and it works, BUT, this looks much too complicated to me.
I have also done a server using fork() on connect, but if I have a big
program and many connects I guess this is not the best way :)
Any suggestions?? Thank you!!