I am really interested in event-driven programming in C especially with sockets so I am going to dedicate some time doing my researches.
Let\'s assume that I want to bui
That kind of TCP servers/clients can be implemented by using select(2) call and non-blocking sockets.
It is more tricky to use non-blocking sockets than blocking sockets.
Example:
connect call usually return -1 immediately and set errno EINPROGRESS when non-blocking socket are used. In this case you should use select to wait when connection is opened or failed. connect may also return 0. This can happen if you create connection to the local host.
This way you can serve other sockets, while one socket is opening a TCP connection.