VB.Net by API/System.Net.Sockets/AddressFamily
Версия от 16:40, 26 мая 2010; (обсуждение)
AddressFamily.InterNetwork
Imports System.Net.Sockets
Imports System.Net
Imports System.Threading
Public Class Tester
Dim Shared mySocket As Socket
Public Shared Sub Main
Dim myThread As New Thread(New ThreadStart(AddressOf StartConnection))
myThread.Start()
End Sub
Private Shared Sub StartConnection()
Try
mySocket = New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
mySocket.Connect(New IPEndPoint(IPAddress.Parse("192.168.1.100"), 12335))
Catch ex As SocketException
Console.WriteLine(ex.Message)
End Try
End Sub
End Class