Sample code for 30+ languages & platforms
CkPython Requires Chilkat v11.0.0+

Example: Socket.AcceptNext method

Demonstrates how to call the AcceptNext method.

Chilkat CkPython Downloads

CkPython
import sys
import chilkat

success = False

listenSocket = chilkat.CkSocket()
connectedSocket = chilkat.CkSocket()

port = 5555
backlog = 25
success = listenSocket.BindAndListen(port,backlog)
if (success == False):
    print(listenSocket.lastErrorText())
    sys.exit()

#  Accept next incoming connection
maxWaitMs = 200000
success = listenSocket.AcceptNext(maxWaitMs,connectedSocket)
if (success == False):
    print(listenSocket.lastErrorText())
    sys.exit()

#  ...
#  ...

maxWaitMs = 20000
connectedSocket.Close()