Jump to content
Sign in to follow this  

UDP receive problem

Recommended Posts


Im playing around with UDP and I come across a problem I can seem to figure out.

If I use the following code, I get a msg box that says "Connected" and I receive data from my send command.

$socket = UDPBind("", 65532)
If @error = 0 Then 
While 1
$data = UDPRecv($socket, 50)
If $data <> "" Then
MsgBox(0, "UDP DATA", $data, 1)
MsgBox("Not Connected","Not Connected","Not Connected")

If I change "$socket = UDPBind("", 65532)" to my real ip..lets just say "$socket = UDPBind("", 65532)" then it will not connect. From what I understand is just an ip of your self, so I dont see why changing that to what my real ip address is, would cause ti not to work anymore.

Share this post

Link to post
Share on other sites

Are you running a software firewall that isn't allowing that port?


I think I figured it out. I think the problem is, im a bit confused on what type of file actually needs to be on each computer.

After reading a few other peoples scripts im abit confused on what is suppoed to be happening.

I think I need a script on my side that sends the data and a script on their end to receive the data. Is there a third script a udp server script that I need? And if so, which computer is it supposed to reside on?

Is this correct?

Share this post

Link to post
Share on other sites

Ok I got it working.

The problem was

$socket = UDPBind("any ip adress", 65532)

was supposed to be

$socket = UDPBind(@IPAddress1, 65532)

Didnt matter what IP address I used, client or server computer it wouldnt connect.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.