Jump to content

Recommended Posts

Posted

I want to check if the message from UDPsend() arrived at the goal IPAddr.

The standard @error messages just tell me:

-1, -2 or -3 invalid socketarray.
1 - IPAddr is incorrect.
2 - port is incorrect.

But I want to know if the IPAddr was reachable.

I think _WinAPI_ could be usefull but I don't know what function I need.

Here a shortcut of my script:

#include <WinAPIDiag.au3>

; =================================================
; Topic.......: UDP StartUp :......................
Global $socketPort = 1927
UDPStartUp()
$udpSocket = UDPBind(@IPAddress1, $socketPort)
$starttime = TimerInit()
; =================================================

_UDP_Send_alive()

Func _UDP_Send_alive()
$socket = UDPOpen("10.46.229.220", 1927, 1)
$send = UDPSend($socket, "Test")
$error_classic = @error
$error_winAPI = _WinAPI_GetErrorMessage($send,)
ConsoleWrite($error_winAPI & @CRLF & $error_classic & @Crlf)
EndFunc
Posted

Hello JohnOne,

Thank your for your quick reply !

In the reference of UDPSend is mentioned "windows API WSAGetError return value (see MSDN)."

So I thought that on some way it is possible to get more error informations with _WinAPI_.

But if not then not...

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
  • Recently Browsing   0 members

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