UdpClient.Connect (IPEndPoint) establishes a default remote host using the specified network endpoint.
Imports System.IO
Imports System.Net
Imports System.Text
Imports System.Net.Sockets
publicclass MainClass
Shared Sub Main()
Dim udpClient As New UdpClient()
Dim ipAddress As IPAddress = Dns.Resolve("www.domain.com").AddressList(0)
Dim ipEndPoint As New IPEndPoint(ipAddress, 11004)
Try
udpClient.Connect(ipEndPoint)
Catch e As Exception
Console.WriteLine(e.ToString())
End Try
End Sub
End Class