Sign in to follow this  
Followers 0
aquila

UDP recv

16 posts in this topic

#1 ·  Posted (edited)

Hello,

I started to make a Script which sends some pakets over a UDP Port. It's working fine but i have one Problem. A Server is sending me some pakets on port 1337, when someone wrote something on a Server. This is my code:

$socket = UDPOpen($IP, 1337)
While True
    $udprecv = UDPRecv($socket, 999999)
    If $udprecv <> "" Then
        $udprecv = BinaryToString($udprecv)
        MsgBox(0, "", $udprecv)
    EndIf
    Sleep(100)
WEnd

Why is it not working? I am sure that the pakets are sending to my PC. I checked it with a Sniffer. My second question is, why do i need UDPOpen? Why is there no UDPListen? I just want to pick up the packets, which i got. This is so :/

Greetz

Edited by aquila

Share this post


Link to post
Share on other sites



Hello,

I started to make a Script which sends some pakets over a UDP Port. It's working fine but i have one Problem. A Server is sending me some pakets on port 1337, when someone wrote something on a Server. This is my code:

$socket = UDPOpen($IP, 1337)
While True
    $udprecv = UDPRecv($socket, 999999)
    If $udprecv <> "" Then
        $udprecv = BinaryToString($udprecv)
        MsgBox(0, "", $udprecv)
    EndIf
    Sleep(100)
WEnd

Why is it not working? I am sure that the pakets are sending to my PC. I checked it with a Sniffer. My second question is, why do i need UDPOpen? Why is there no UDPListen? I just want to pick up the packets, which i got. This is so :/

Greetz

Have you missed out UPDStartup()?

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Have you missed out UPDStartup()?

Of Course not :) $IP is also correct. And i am sure !!! The Port is open!!! And i know that there are packets!

I Think something with the UDPOpen is incorrect. Maybe Bind? I don't know :/

Edited by aquila

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Okay, but this is not fixxing my problem :/ Anyone a idea how i can pickup the UDP-Pakets which are sending to me?

Edited by aquila

Share this post


Link to post
Share on other sites

Okay, i make a screenshot of Wireshark. And what do you mean with the code of Client?

Share this post


Link to post
Share on other sites

Well, The Server sends me Packets, because i made a logaddress to me, and so he sends me everythings, what is happening on the server in pakets to me.

Share this post


Link to post
Share on other sites

Error 10049, i know there was a Page where i could look. But i forgot :/

Share this post


Link to post
Share on other sites

See here http://www.ultrabac.com/kb/ubq000192.htm

WSAEADDRNOTAVAIL

Error Number: 10049

Cannot assign requested address.

The requested address is not valid in its context. Normally

results from an attempt to bind to an address that is not

valid for the local machine, or connect/sendto an address

or port that is not valid for a remote machine.

--------------------------------------------------------------------------------


A lan chat (Multilanguage)LanMuleFile transferTank gameTank 2 an online game[center]L'esperienza è il nome che tutti danno ai propri errori.Experience is the name everyone gives to their mistakes.Oscar Wilde[/center]

Share this post


Link to post
Share on other sites

AH !! WORKING :) But only with my lan ip 192.168.2.101, why not with localhost or 127.0.0.1?

Thx 4 help.

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