Forum Discussion
Altera_Forum
Honored Contributor
12 years agoCan the connect() for a TCP client be configured as "blocking" ?
I'm developing a TCP client using NicheStack. Can the connect() for a TCP client be configured as "blocking" ? Currently, if no server is listening for the connection the connect() returns -...
Altera_Forum
Honored Contributor
12 years agoThanks for confirming that the connect() should block by default. For some unknown reason, in my case, it does not block.
I have tried to use setsockopt() to guarantee that the socket is setup as "blocking" but the connect() stills returns -1 if a server is not currently listening. By the way, my recv() call does block as expected. I'm going to continue to investigate why the connect() is not behaving as expected. I'm also going to check out the file "ipport.h".