Sign in to follow this  
Followers 0
loki1982

UDP receive problem

4 posts in this topic

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("127.0.0.1", 65532)
If @error = 0 Then 
    MsgBox("Connected","Connected","Connected")
While 1
$data = UDPRecv($socket, 50)
If $data <> "" Then
MsgBox(0, "UDP DATA", $data, 1)
EndIf
sleep(100)
WEnd
endif
MsgBox("Not Connected","Not Connected","Not Connected")
sleep(2000)
Exit

If I change "$socket = UDPBind("127.0.0.1", 65532)" to my real ip..lets just say "$socket = UDPBind("195.3.1.192", 65532)" then it will not connect. From what I understand 127.0.0.1 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?

:whistle:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

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

:whistle:

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  
Followers 0