tk03
05-12-2003, 01:19 PM
I'm trying to connect to a remote server with a nonblocking socket(Set with fcntl()).
Of course connect returns EINPROGRESS but I'm not sure how to get it past what netstat reports as the SYN_SENT state and actually connected(send() returns Resource unavailable).
I'm basically trying to rewrite the networking code of my program from memory with some modifications but it's working as well as I'd hoped. I'm using non-blocking sockets so I can avoid the problems with forking(X11 doesn't like be used by multiple processes).
I've heard that I'm supposed to just wait until select() for connect to finish but I get a quick stream of select reponses(Not sure how the server responded but my get line code that always is called when select is active gives a empty string) and then nothing more unless I try connecting it to a HTTP server(not the target protocol) in which I get continuous select response. Thanks for any help in advance.
Of course connect returns EINPROGRESS but I'm not sure how to get it past what netstat reports as the SYN_SENT state and actually connected(send() returns Resource unavailable).
I'm basically trying to rewrite the networking code of my program from memory with some modifications but it's working as well as I'd hoped. I'm using non-blocking sockets so I can avoid the problems with forking(X11 doesn't like be used by multiple processes).
I've heard that I'm supposed to just wait until select() for connect to finish but I get a quick stream of select reponses(Not sure how the server responded but my get line code that always is called when select is active gives a empty string) and then nothing more unless I try connecting it to a HTTP server(not the target protocol) in which I get continuous select response. Thanks for any help in advance.