CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 1 of 1

Hybrid View

  1. #1
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652

    Visual C++ Network: How to set a socket option?

    Q: How to set a socket option?

    A: Socket options can be set using the 'setsockopt()' function. The following shows the usage for the 'SO_REUSEADDR' option (others are set the same way).

    Code:
    int iOptval = 1;
    
    if(::setsockopt(Socket, SOL_SOCKET, SO_REUSEADDR, (char *) &iOptval, sizeof(int)))
      // Error -> call ::WSAGetLastError()
    Last edited by Andreas Masur; July 25th, 2005 at 02:36 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured