110,534
社区成员
发帖
与我相关
我的任务
分享
private byte[] KeepAliveTime
{
get
{
uint dummy = 0;
byte[] inOptionValues = new byte[Marshal.SizeOf(dummy) * 3];
BitConverter.GetBytes((uint)1).CopyTo(inOptionValues, 0);
BitConverter.GetBytes((uint)5000).CopyTo(inOptionValues, Marshal.SizeOf(dummy));
BitConverter.GetBytes((uint)5000).CopyTo(inOptionValues, Marshal.SizeOf(dummy) * 2);
return inOptionValues;
}
}
private int keepAlive = -1744830460;
private byte[] inValue = new byte[] { 1, 0, 0, 0, 0x20, 0x4e, 0, 0, 0xd0, 0x07, 0, 0 };
SocketClient.IOControl(keepAlive, inValue, null);
SocketClient.IOControl(IOControlCode.KeepAliveValues, KeepAliveTime, null);
SocketClient.Connect(ipenpointServer);