Hello,
I have been trying sometime now to just figure out how to make a UDP connection with VB.NET 2008 and can't seem to figure it out. I even found 4 books on VB.NET but don't mention a thing about sockets but talk about web based stuff. I defitaly need to use a UDP socket. In VB6.0 this was easy. I have search the internet and fourms and put some code together to send hello world. But I can't seem to get it to work... The receiving side is a Linux computer which can receive data sent from itself on 127.0.0.1.
If someone could give me some insite i would really appricate it.
thanks
Code:Imports System.Net.Sockets Imports System.Text Public Class Form1 Dim clientSocket As New UdpClient Private Sub ConnectButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ConnectButton.Click End Sub Private Sub GoLeftButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GoLeftButton.Click Dim bytCommand As Byte() = New Byte() {} clientSocket.Connect(IPTxt.Text, PortTxt.Text) bytCommand = Encoding.ASCII.GetBytes("hello world") clientSocket.Send(bytCommand, bytCommand.Length) End Sub End Class




Reply With Quote