Code: Select all
Global count
Procedure Tcpsrv_connect(param)
Print("connection")
Protected ccontrol_port.l=5555
Protected ccontrol_ip.s="192.168.101.252"
Protected ConnectionID
ConnectionID = OpenNetworkConnection(ccontrol_ip, ccontrol_port)
If ConnectionID
SendStr.s="ok"+#CRLF$
count = count+1
PrintN(" - "+Str(count))
SendNetworkString(ConnectionID, SendStr, #PB_Ascii)
; CloseNetworkConnection(ConnectionID)
EndIf
EndProcedure
InitNetwork()
OpenConsole()
While 1
Tcpsrv_connect(1)
Delay(20)
Wend
update:
I looked at TCP connections on the client side with the netstat -anobq command and found only one connection on port 5555. But at the same time, I observe problems with the browser and network connections at the moment of reaching 16300 connections. Closing the client restores the normal operation of Windows.