I have an Indy Server TIdTCPServer which has 3 bindings for different ports. If I connect a client to those 3 ports, and then deactivate the server, it gets stuck in what appears to be a deadlock. No matter what I do, it won't respond to my click, it won't even report "not responding" to Windows. If I disconnect the client(s) before deactivating the server, everything goes just perfect. I mean "deactivating" as in Server.Active:= False;.
Has anyone else experienced this? What might be causing it? I have nothing happening in here which crosses over threads which could in turn cause a deadlock (for example GUI updates). I tried an Antifreeze component TIdAntiFreeze but no luck.
Activeproperty setter automatically disconnects any active client connections. But it also has to wait for those threads to terminate, and that is where this kind of deadlocking occurs, if those threads are not terminating correctly, typically due to user error in the event handler code. We need to see Jerry's actual code. - Remy LebeauTIdCustomTCPServer.TerminateAllThreads... Unless "RLebeau" is someone else? :P Proof that you DO know what you're talking about - Jerry Dodge