SO_ERROR option

This is a discussion on SO_ERROR option within the C Programming forums, part of the General Programming Boards category; hi Does SO_ERROR option in SOL_SOCKET level return value stored in so_error variable? Does so_error also store asynchronous errors(ICMP error ...

  1. #1
    Registered User
    Join Date
    May 2004
    Posts
    21

    SO_ERROR option

    hi

    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
    Posts
    14,826
    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:

    SO_ERROR
    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?

    Quzah.
    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21