private IPEndPoint LocaIPEP; //udp 本地节点
private IPEndPoint RemoteIPEP; //对方节点
private Socket MyClient; //当前对象
public UdpHandle(IPEndPoint local, IPEndPoint remote)
{
LocaIPEP = local;
RemoteIPEP = remote;
MyClient = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
uint IOC_IN = 0x80000000;
uint IOC_VENDOR = 0x18000000;
uint SIO_UDP_CONNRESET = IOC_IN | IOC_VENDOR | 12;
MyClient.IOControl((int)SIO_UDP_CONNRESET, new byte[] { Convert.ToByte(false) }, null);
MyClient.Bind(local);
}
UDP的IOControl(低级操作模式)
最新推荐文章于 2024-11-08 11:15:26 发布