-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
I modified it(tcpCli.py):
countClosed = 0
pool = XAsyncSocketsPool()
srvAddr = ('192.168.0.190', 8090)
for i in range(1) :
cli = XAsyncTCPClient.Create(pool, srvAddr,5,4096,4096,False)
if cli :
print("Client %s created" % (i+1))
cli.OnFailsToConnect = _onTCPClientFailsToConnect
cli.OnConnected = _onTCPClientConnected
cli.OnClosed = _onTCPClientClosed
else :
print("Error to create client %s..." % (i+1))
pool.AsyncWaitEvents(threadsCount=1)
time.sleep(7)
pool.StopWaitEvents()
Program output:
Client 1 created
On TCP Client Connected
On TCP Client Data Sent (test)
When I send a message to it, the program outputs:
1) On TCP Client Closed (error)
How should I configure to receive information circularly, and whether there is automatic reconnection function
Looking forward to your reply, thank you
Metadata
Metadata
Assignees
Labels
No labels