Function Reference


UDPCloseSocket

Close a UDP socket.

UDPCloseSocket ( socketarray )

Parameters

socketarray The socket/array as returned by a UDPBind or UDPOpen functions.

Return Value

Success: Returns 1.
Failure: Returns 0 and set @error.
@error: -1, -2 or -3 invalid socketarray.
windows API WSAGetError return value (see MSDN).

Remarks

None.

Related

UDPBind, UDPOpen, TCPShutdown, TCPStartup

Example


;SERVER!! Start Me First !!!!!!!!!!!!!!!
Local $g_IP = "127.0.0.1"

; Start The UDP Services
;==============================================
UDPStartup()

; Register the cleanup function.
OnAutoItExitRegister("Cleanup")

; Create a Listening "SOCKET"
;==============================================
Local $socket = UDPBind($g_IP, 65432)
If @error <> 0 Then Exit

;--- Your code here

Func Cleanup()
    UDPCloseSocket($socket)
    UDPShutdown()
EndFunc   ;==>Cleanup