Jump to content

UDP recv


Recommended Posts

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
Link to comment
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.
Link to comment
Share on other sites

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
Link to comment
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]
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...