***Background**** I am new to TCP so I have question that may be a bit basic. I am trying to turn on O_NONBLOCK on a socket that is receiving data. Up until now I have tried to different ways to set O_NONBLOCK, itcl() and fcntl(). Right now I am trying to get fcntl() to work.
My Question: Are you supposed to set O_NONBLOCK before you connect the socket or after?
**my current implementation of fcntl() is based off off the link before the code:
How to reset a socket back to blocking mode (after I set it to nonblocking mode)?
//set socket to NONBlocking
on = fcntl(Socket,F_GETFL);
on = (on | O_NONBLOCK);
if(fcntl(Socket,F_SETFL,on) < 0)
{
perror("turning NONBLOCKING on failed\n");
}
// DO CONNECT
rc = connect()
Thank you for taking the time to look at this