TCPStartup, UDPStartup
启动 TCP 或 UDP 服务.
TCPStartup ( )
UDPStartup ( )
返回值
成功:
|
返回 1.
|
失败:
|
返回 0, @error 设置 为非 0 值.
|
@error:
|
windows API WSAStartup 的返回值 (请查阅 MSDN).
|
备注
必须有一个 TCPShutdown() 调用,以避免内存消耗.
每当成功完成 TCPStartup() 调用后,必须调用 TCPShutdown() 关闭网络通信.
UDPStartup() 是 TCPStartup() 的别名.
相关
TCPAccept, TCPCloseSocket, TCPConnect, TCPListen, TCPNameToIP, TCPRecv, TCPSend, TCPShutdown, UDPCloseSocket
函数示例
Start the TCP service.
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
Start the UDP service
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
----------------------------------------
|