Function Reference


TCPStartup, UDPStartup

Starts TCP or UDP services.

TCPStartup ( )
UDPStartup ( )

Parameters

None.

Return Value

Success: 1.
Failure: 0 and sets the @error flag to non-zero.
@error: windows API WSAStartup return value (see MSDN).

Remarks

There must be a TCPShutdown() call to avoid memory consumption.
A script must call one TCPShutdown() call for every successful TCPStartup() call.
UDPStartup() is just an alias of TCPStartup().

Related

TCPShutdown, TCPListen, TCPCloseSocket, UDPCloseSocket, TCPAccept, TCPConnect, TCPNameToIP, TCPRecv, TCPSend

Example

Example 1

Example()

Func Example()
    TCPStartup() ; Start the TCP service.

    ; Register OnAutoItExit to be called when the script is closed.
    OnAutoItExitRegister("OnAutoItExit")
EndFunc   ;==>Example

Func OnAutoItExit()
    TCPShutdown() ; Close the TCP service.
EndFunc   ;==>OnAutoItExit

Example 2

Example()

Func Example()
    UDPStartup() ; Start the UDP service.

    ; Register OnAutoItExit to be called when the script is closed.
    OnAutoItExitRegister("OnAutoItExit")
EndFunc   ;==>Example

Func OnAutoItExit()
    UDPShutdown() ; Close the UDP service.
EndFunc   ;==>OnAutoItExit