Curiously, when I close the window in this way, the application continues and executes the line PrintN("Server has closed...") although it doesn't execute this if I close the console application by pressing CTRL/C. The line PrintN("Server has closed...") is not executed until I click the application close button, which suggests to me that there is some wrapping-up being done, perhaps with a bug that doesn't like the fact that a network connection was active. I don't seem to be able to resolve this, as it's being done outside my control.
Code: Select all
netevent.i = NetworkClientEvent(netservercon.i) ; Obtain the event, if any
Select netevent.i ; Check for event types
PrintN("Server has closed the connection : " + nethostname)
If I use the purifier, it highlights a call to an unrelated procedure responsible simply for outputting text to the console, saying 'memory error etc.'. It's the same call that's sending the message "Server has closed the connection" and therefore nothing wrong with that procedure. It seems that something PureBasic is doing to wrap-up networking usage, contains a bug.