PB 5.21 b 2 - OpenNetworkConnection
Posted: Tue Nov 12, 2013 7:26 pm
Function OpenNetworkConnection() returns a non-zero result, even if not connect to the server.
I can assume that the connection is established in the asynchronous mode. And it confirms the following code.
But why, then, the program Crash after a few tens of seconds, in line with function NetworkClientEvent()?
Code: Select all
InitNetwork()
Debug OpenNetworkConnection("192.168.0.8", 1234, #PB_Network_TCP)
Debug OpenNetworkConnection("192.168.0.5", 4321, #PB_Network_TCP)Code: Select all
InitNetwork()
For x=0 To 255
For y=0 To 255
String.s = "192.168."+Str(x)+"."+Str(y)
z=OpenNetworkConnection(String, 1234, #PB_Network_TCP)
If z
CloseNetworkConnection(z)
Debug String
EndIf
Next y
Next xCode: Select all
InitNetwork()
x = OpenNetworkConnection("192.168.0.8", 1234, #PB_Network_TCP)
Repeat
z=NetworkClientEvent(x)
If z<>#PB_NetworkEvent_None
Debug z
Else
Delay(10)
EndIf
ForEver