Sample code for 30+ languages & platforms
AutoIt

Example: Socket.AcceptNext method

Demonstrates how to call the AcceptNext method.

Chilkat AutoIt Downloads

AutoIt
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()