Hi people
I know i've posted something similar to this before, but it's a completely different question.
The problem is, that with the following code, port 54545 does not work. The code is intended to send a message via the port variable to the IP address.
I want the code to be able to, for example, send a message to you, the one reading this, if you have the receiver program (which has to be anywhere in the world, providing you have a network connection)
Imports System.Net
Imports System.Net.Sockets
Imports System.Threading
Imports System.Text
Public Class Form1
Private Const port As Integer = 54545
Dim RecipientIPAddress As String = Nothing
Private sendingClient As UdpClient
Private Sub SendMsgButton_Click() Handles SendMsgButton.Click
RecipientIPAddress = IPToSendToTextbox.text
InitializeSender()
End Sub
Private Sub InitializeSender()
sendingClient = New UdpClient(RecipientIPAddress, port)
sendingClient.EnableBroadcast = True
End Sub
Public toSend As String
Dim data() As Byte
Public Shared Sub go()
form1.data = Encoding.ASCII.GetBytes(form1.toSend)
form1.sendingClient.Send(form1.data, form1.data.Length)
End Sub
end class
Things I know about the problem:
* UDPClient Ports range from 5454[2-5]
* Port 80 doesn't work
Does anyone know a port number that will work for this?
Thanks.