Create TcpClient : TcpClient « Socket Network « VB.Net Tutorial






Imports System.Net.Sockets
Imports System.Net
Imports System.Threading
Imports System.Text

Public Class Tester
    
    Public Shared Sub Main
        Dim myTcpClient As New TcpClient()
        Try
            myTcpClient.Connect("127.0.0.1", 1234)
        Catch ex As ArgumentOutOfRangeException
            Console.WriteLine(ex.Message)
        Catch ex As SocketException
            Console.WriteLine(ex.Message)
        End Try
    End Sub

End Class
No connection could be made because the target machine actively refused it








22.12.TcpClient
22.12.1.Create TcpClient
22.12.2.Date time client based on TcpClient