After I call connect I call application processmessages until I get
connected and then I close.

Do you think this could be "interfering" with the HttpServer component

Not excatly the logic, but it will make things go wrong because calling ProcessMessages will cause events to be triggered then have the component reenter his event handler before the previous event is processed. That will not work !

Is doing the communication socket call in a separate thread better than in
the main thread?

No need for another thread. Just use asynchronous operation. From the server event, you may defer sending the reply to the client until you are done with what you have to do with the secondary connection. Just use hgSendMyself to make the server component happy. Later, in the event chain you'll trigger calling TWSocket, call one of the Answer methods to send the reply to the client.

You only need a thread when you have to do a lengthy operation such as computation or blocking SQL request.

The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)

To unsubscribe or change your settings for TWSocket mailing list
please goto
Visit our website at

Reply via email to