Are you running in a multi threaded environment?
bsd socket calls return the number of read or written bytes or -1 in case of error and if that happens errno is set.
And errno is different if your app is mutlithreaded or not as every thread needs its own errno. So historically it was a int but now its a macro to get it from the thread specific memory so your thread gets your "private" thread errno.
When you set the socket to non blocking or blocking yourself, then it stays in this mode until you change it. However certain things can occur while you sit in a wait call (poll/ select etc) which can make the call return early (EAGAIN for example) which means you have to be prepared for this and maybe have a loop to wait until you have enough data. Also in the case of TCP, your data might be chunked up in the middle. You can never assume one line is sent as a whole, it can arrive in pieces.
I dont think anything has really changed between 10.8 to 10.12 in this area.
------------------------------------------------------------------
Author of ulib networking library
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden