aquila Posted March 23, 2008 Share Posted March 23, 2008 (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 March 23, 2008 by aquila Link to comment Share on other sites More sharing options...
martin Posted March 23, 2008 Share Posted March 23, 2008 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 More sharing options...
aquila Posted March 23, 2008 Author Share Posted March 23, 2008 (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 March 23, 2008 by aquila Link to comment Share on other sites More sharing options...
Fabry Posted March 23, 2008 Share Posted March 23, 2008 try to decrease the lendght of data from 999999 to 1000 it's enough. 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 More sharing options...
aquila Posted March 23, 2008 Author Share Posted March 23, 2008 (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 March 23, 2008 by aquila Link to comment Share on other sites More sharing options...
Fabry Posted March 23, 2008 Share Posted March 23, 2008 Use wireshark to see if the paket is sent. Post the code of client. 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 More sharing options...
aquila Posted March 23, 2008 Author Share Posted March 23, 2008 Okay, i make a screenshot of Wireshark. And what do you mean with the code of Client? Link to comment Share on other sites More sharing options...
Fabry Posted March 23, 2008 Share Posted March 23, 2008 Post the code of client, where it sends the packet. 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 More sharing options...
aquila Posted March 23, 2008 Author Share Posted March 23, 2008 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. Link to comment Share on other sites More sharing options...
Fabry Posted March 23, 2008 Share Posted March 23, 2008 Use UDPopen to send using UDPsend. Use UDPbind to receive using UDPrecv. 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 More sharing options...
aquila Posted March 23, 2008 Author Share Posted March 23, 2008 Okay,http://iamlegend1337.ia.funpic.de/pakets.jpg Link to comment Share on other sites More sharing options...
Fabry Posted March 23, 2008 Share Posted March 23, 2008 Use UDPbind instead of UDPopen 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 More sharing options...
aquila Posted March 23, 2008 Author Share Posted March 23, 2008 Error 10049, i know there was a Page where i could look. But i forgot :/ Link to comment Share on other sites More sharing options...
Fabry Posted March 23, 2008 Share Posted March 23, 2008 See here http://www.ultrabac.com/kb/ubq000192.htmWSAEADDRNOTAVAILError Number: 10049Cannot 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 More sharing options...
aquila Posted March 23, 2008 Author Share Posted March 23, 2008 AH !! WORKING But only with my lan ip 192.168.2.101, why not with localhost or 127.0.0.1? Thx 4 help. Link to comment Share on other sites More sharing options...
Fabry Posted March 23, 2008 Share Posted March 23, 2008 You are welcome. 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now