c - What is SOCKET accept() error errno 316? -


on osx keep getting socket error of 316 after calling accept() on bound & listening socket. valid socket returned, , believe use fine, (though may not be, need double check this, accepting hundreds of connections @ moment) errno has been set.

i'm trying understand the documentation on unix accept(2) man pages notes (which, incidentally, missing apple's accept() documentation)

linux accept() (and accept4()) passes already-pending network errors on new socket error code accept(). behavior differs other bsd socket implementations. reliable operation application should detect network errors defined protocol after accept() , treat them eagain retrying.

now, 316 works out 256 or'd etimedout(60). so, i'm curious how should handling this;

  1. if error set after accept(), should accept() again?
  2. should close() socket accept did return?
  3. are unix errno code's 8 bit? (all codes see <128) , erroneous bit set in memory, or special flag, warning (i cannot find documentation on errno format's)
  4. does error mean connection popped stack timed out... , os disconnected them, or wasn't accept()'d me fast enough?

do not examine errno unless accept() has returned -1. if accept() returns valid file descriptor value of errno undefined.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -