Thread: SO_ERROR option

  1. #1
    Registered User
    Join Date
    May 2004

    SO_ERROR option


    Does SO_ERROR option in SOL_SOCKET level return value stored in so_error variable?
    Does so_error also store asynchronous errors(ICMP error replies)?
    Shouldn't so_error be reset back to 0 after you fetch its value using getsockopt?I called getsockopt() twice and it didn't reset it to 0 after the first call
    In what header is this variable defined?

    thank you for your time

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Since you've alread stated that you have Unix Network Programming, why on earth don't you take two seconds and use the INDEX located at the back of the book? Here, let me quote, because you apparently can't find it on your own:
    Unix Network Programming, W. Richard Stevens

    "Socket Options", Page 319:

    Returns to the caller the current contents of the variable so_error, which is defined in <sys/socketvar.h>. This variable holds the standard Unix error numbers (the same values found in the Unix errno variable) for the socket. This error variable is then cleared by the kernel.
    Do you just like seeing yourself type, or do you really just not know how to use a book properly?

    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed