下面的示例连接到远程终结点,然后验证该连接。
[C#]
aSocket.Connect(anEndPoint);
if (!aSocket.Connected) {
Console.WriteLine("Winsock error: "
+ Convert.ToString(System.Runtime.InteropServices.Marshal.GetLastWin32Error()));
}
[C#]
aSocket.Connect(anEndPoint);
if (!aSocket.Connected) {
Console.WriteLine("Winsock error: "
+ Convert.ToString(System.Runtime.InteropServices.Marshal.GetLastWin32Error()));
}