PB recovery from network outage / Do PureBasic networking functions require ‘ping’?
Posted: Tue Jan 23, 2024 9:49 pm
Today we had a network outage at the office and consequently my PB client-side application disconnected from its corresponding PB server-side application. Three users’ PB clients were able to reconnect and continue working after the connection came back up. One PC was unable to reconnect.
Rather than just reboot that PC, I tried to properly establish what was going on. I found that RDP on this user’s PC, connected to that same server without any problems, but my PB application on THIS PC only, was unable to reconnect.
I closed the PB client application and restarted it. It still would not reconnect. Finally I changed the client’s server hostname to the fixed IP address of the server and the PB client then reconnected okay.
To summarise : All PB clients had connected to the server using its hostname, though only that one PC had a problem reconnecting after the outage. It would only reconnect after I changed the server address for the client from 'name' to its IP. On the face of it, it seemed like a DNS problem, but other applications, such as RDP, allowed me to connect using the server’s hostname.
The only oddity I’m aware of is that Windows Server 2019 onwards, doesn’t have ping turned on by default, so I wondered if PB requires ping to be working (a bit of a long-shot I know).
Server and client connections are established with the following :
Any other ideas on this that might help me to prevent this happening in future? Appreciate any thoughts on this.
Rather than just reboot that PC, I tried to properly establish what was going on. I found that RDP on this user’s PC, connected to that same server without any problems, but my PB application on THIS PC only, was unable to reconnect.
I closed the PB client application and restarted it. It still would not reconnect. Finally I changed the client’s server hostname to the fixed IP address of the server and the PB client then reconnected okay.
To summarise : All PB clients had connected to the server using its hostname, though only that one PC had a problem reconnecting after the outage. It would only reconnect after I changed the server address for the client from 'name' to its IP. On the face of it, it seemed like a DNS problem, but other applications, such as RDP, allowed me to connect using the server’s hostname.
The only oddity I’m aware of is that Windows Server 2019 onwards, doesn’t have ping turned on by default, so I wondered if PB requires ping to be working (a bit of a long-shot I know).
Server and client connections are established with the following :
Code: Select all
svrid.i = CreateNetworkServer(#PB_Any, portno.i, #PB_Network_IPv4 | #PB_Network_TCP, "")
svrcon.i = OpenNetworkConnection(hostname.s, portno.i, #PB_Network_IPv4 | #PB_Network_TCP, netout.i)