For a clean Client shut-down, when using multi-threaded connection components, you need to close the connection before closing the Application. This is done by using the "DisconnectNow" method on the TRtcHttpClient component. On the Server-side, use the "StopListenNow" method on the TRtcHttpServer component.
That is also
explained in this FAQ topic.
Best Regards,
Danijel Tkalcec