Create Udp Connection using UdpClient : UdpClient « Socket Network « VB.Net Tutorial






Imports System.Net
Imports System.Net.Sockets

Public Class Tester
    Public Shared Sub Main
    
        Dim myUdpClient As UdpClient

        Try
            Dim myEndPoint As New IPEndPoint(IPAddress.Parse("127.0.0.1"), 12345)

            myUdpClient = New UdpClient()
            myUdpClient.Connect(myEndPoint)

        Catch ex As Exception
            Console.WriteLine(ex.Message)
        End Try
    End Sub

End Class








22.15.UdpClient
22.15.1.Create Udp Connection using UdpClient
22.15.2.Use UdpClient to send message
22.15.3.Use UdpClient to receive data
22.15.4.Use UdpClient to send a file
22.15.5.Use UdpClient to receive a file