# 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 according to WSAGetLastError Windows API return.

Remarks

None.

Related

UDPBind, UDPOpen

Example

;SERVER!! Start Me First !!!!!!!!!!!!!!!
$g_IP = "127.0.0.1"
; Start The UDP Services
;==============================================
UDPStartUp()
; Create a Listening "SOCKET"
;==============================================
$socket = UDPBind($g_IP, 65432)
If @error <> 0 Then Exit
;--- Your code here
Func OnAutoItExit()
UDPCloseSocket($socket)
UDPShutdown()
EndFunc