Private Declare Function setsockopt Lib "wsock32.dll" (ByVal s As Long, ByVal level As Long, ByVal optname As Long, optval As Any, ByVal optlen As Long) As Long
Public Declare Function setsockopt Lib "ws2_32.dll" (ByVal s As Long, ByVal level As Long, ByVal optname As Long, optval As Any, ByVal optlen As Long) As Long
Public Const SOL_SOCKET = 65535
'
' option flags per socket
Public Const SO_DEBUG = &H1& ' Turn on debugging info recording
Public Const SO_ACCEPTCONN = &H2& ' Socket has had listen() - READ-ONLY.
Public Const SO_REUSEADDR = &H4& ' Allow local address reuse.
Public Const SO_KEEPALIVE = &H8& ' Keep connections alive.
Public Const SO_DONTROUTE = &H10& ' Just use interface addresses.
Public Const SO_BROADCAST = &H20& ' Permit sending of broadcast msgs.
Public Const SO_USELOOPBACK = &H40& ' Bypass hardware when possible.
Public Const SO_LINGER = &H80& ' Linger on close if data present.
Public Const SO_OOBINLINE = &H100& ' Leave received OOB data in line.
Public Const SO_DONTLINGER = Not SO_LINGER
Public Const SO_EXCLUSIVEADDRUSE = Not SO_REUSEADDR ' Disallow local address reuse.
' Additional options.
Public Const SO_SNDBUF = &H1001& ' Send buffer size.
Public Const SO_RCVBUF = &H1002& ' Receive buffer size.
Public Const SO_ERROR = &H1007& ' Get error status and clear.
Public Const SO_TYPE = &H1008& ' Get socket type - READ-ONLY.