Well, I figured out that connect() always fails if the unconnected socket is in non-blocking mode. So I set in to non-blocking mode after connection. Now the server-client-connections works all fine except of I have no clue how to recognize the server's disconnection. If the server closes its socket, the non-blocking client still returns -1 on read() meaning no data available. It never returns 0.
On the other hand: if the client closes the connection, the read()-method on the server side returns 0 indicating the client's closure. But that procedure does not work on the client side in case of a server's socket closure
Maybe there is some bug in my code I do not know about, cause this is my first socket encapsulation. But referring to all used documentation I think it's ok like that... However: if anybody would like to see my code: email me
cause my webspace-provider does not support http-downloads
. Remember: I used winsock1. If you're gonna test it under unix, please include the corresponding headers yourself. Thx.
I'd appreciate any kind of constructive critic/help.