setsockopt写法正确吗?
DECLARE LONG setsockopt IN "Ws2_32" long s ,long level,long optname ,long optval ,long optlen &&"wsock32.dll"DECLARE LONG getsockopt IN "Ws2_32" long s ,long level,long optname ,long @optval ,long optlen&&"wsock32.dll"
#define SOL_SOCKET 65535
#define SO_REUSEADDR 0x0004
setsockopt(Thisform.tcpClient.OBJECT.SocketHandle, SOL_SOCKET, SO_REUSEADDR, 1, 1)
C语言使用如下
*!* int on = 1;
*!* setsockopt(listenfd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
为了解决Address in use C:\Windows\SysWOW64\mswinsck.ocx
[此贴子已经被作者于2023-8-28 09:32编辑过]