Opened 16 years ago
Last modified 15 years ago
#938 closed Feature Request
UDPOpen and/or UDPSend to 255.255.255.255 doesn't work — at Initial Version
Reported by: | skyteddy | Owned by: | |
---|---|---|---|
Milestone: | 3.3.1.1 | Component: | AutoIt |
Version: | Severity: | None | |
Keywords: | UDP, UDPOpen, UDPSend, 255.255.255.255 | Cc: |
Description
Hello,
I try to send a message via UDP to the LAN-independent broadcast-IP-address 255.255.255.255, but nothing happens. If I use wireshark for control, I see nothing. It looks like, that AutoIt doesn't send anything. And I don't get any error too. It seems, it works, but it doesn't! It is independet which port I use. And I can't say, if UPPOpen or UDPSend makes the failure, or both.
If I change the broadcast-address to the LAN-specific-address e.g. 192.168.10.255, it works and I see the packets in wireshark. But I need to send the packet to 255.255.255.255 :-)
(((
Global $Port = "5035"
Global $BroadcastAdr = "255.255.255.255"
; Global $BroadcastAdr = "192.168.178.255"; Sending and receiving works (netmask = 255.255.255.0)
; Start UDP
UDPStartup()
If @error <> 0 Then
MsgBox(0, "UDP Startup Error", @error, 1)
Exit
EndIf
; open UDP socket
$SendSocket = UDPOpen($BroadcastAdr, $Port)
If @error <> 0 Then
MsgBox(0, "UDP Open Error (for sending)", @error, 1)
Exit
EndIf
; Sending
$Counter = 1
While $Counter <= 20
$SendStatus = UDPSend($SendSocket, "Hello")
If $SendStatus = 0 Then
MsgBox(0, "ERROR", "Error while sending UDP message: " & @error)
Exit
EndIf
WEnd
; --- Exit ---
Exit
Func OnAutoItExit()
; --- Close Sockets ---
UDPCloseSocket($SendSocket)
; --- Stop UDP ---
UDPShutdown()
EndFunc ;==>OnAutoItExit
)))
Details to my problem and a larger example script you will find at:
http://www.autoitscript.com/forum/index.php?showtopic=94048&view=findpost&p=675676
Thanks in advance
R@iner