VB.Net by API/System.Net.Sockets/AddressFamily — различия между версиями

Материал из VB Эксперт
Перейти к: навигация, поиск
м (1 версия)
 
(нет различий)

Версия 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