Éric Fleming Bonilha wrote:
> Hello Wilfried,
>
> Ok, I will make that way, but do you know the implications of doing the way
> I said? It can cause the host to make some half-closed connections?
The implication is that the TWSocket control may not have entered the
proper state and still be in the process of disconnecting. If this
happens, calling Connect() again will raise an exception saying
"Component Not Ready".
The TWSocket components are designed to be "event-driven", which means
that all logic should be built as a reaction to an event. In your case,
you want to re-connect not when you told the component to disconnect,
but when the component actually disconnected, at which time the
OnSessionClosed event will be triggered. Therefore, your action to
connect is in reaction to the OnSessionClosed event.
This model is followed throughout the entire design of the components:
e.g. you do not read data from the component when you asked it to
retrieve it from the server, but when the data is actually received.
There are all sorts of events exposed in each component to react at any
conceivable state of its life-cycle.
-dZ.
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be