AutoIt
AutoIt
Example: Socket.AcceptNext method
Demonstrates how to call the AcceptNext method.Chilkat AutoIt Downloads
Local $bSuccess = False
$oListenSocket = ObjCreate("Chilkat.Socket")
$oConnectedSocket = ObjCreate("Chilkat.Socket")
Local $iPort = 5555
Local $iBacklog = 25
$bSuccess = $oListenSocket.BindAndListen($iPort,$iBacklog)
If ($bSuccess = False) Then
ConsoleWrite($oListenSocket.LastErrorText & @CRLF)
Exit
EndIf
; Accept next incoming connection
Local $iMaxWaitMs = 200000
$bSuccess = $oListenSocket.AcceptNext($iMaxWaitMs,$oConnectedSocket)
If ($bSuccess = False) Then
ConsoleWrite($oListenSocket.LastErrorText & @CRLF)
Exit
EndIf
; ...
; ...
$iMaxWaitMs = 20000
$oConnectedSocket.Close()