Disabling a TROSynapseSuperTCPServer does not disconnect clients

I’m using a TROSynapseSuperTCPServer instance in one of my servers and under some circumstances I set its Active property to False

Considering that the server is inactive when this happens, I assumed that any client connected at the time would get disconnected.
But this is not the case, their channel OnDisconnected event is not triggered and they can even continue to communicate with the server!

It’s only when the server gets destroyed that the clients are disconnected and that they loose the ability to perform requests to the server.

Here is a sample application showing this: ROSynapseOnDisconnected.zip (119.4 KB)

My test steps are as follows:

  1. Start ROSynapseOnDisconnectedServer.exe
  2. Start ROSynapseOnDisconnectedClient.exe
  3. In the client, click on the Connect button
    • Notice the message saying OnConnected has been called
  4. In the client, click on the GetSum button
    • Notice the response from the server
  5. In the server, click on the Disable Server button
    • Notice that nothing happens on the client
  6. In the client, click again on the GetSum button
    • Notice that you get an answer from the server, despite being inactive
  7. In the server, click on the Destroy server button
    • This time, the client log says OnDisconnected has been called

I’m very surprised by the fact that disabling the server does not disconnect, and even more surprised that already connected clients can still communicate with the server despite it being inactive.

I find it hard to believe this is expected behavior, but apart from destroying the server component, is there a way to disable the server while disconnecting all currently connected clients?

Thanks, logged as bugs://85378

bugs://85378 got closed with status fixed.