Hello Francois,

I'm not using a TDataModule but as I mentioned in my other email,
I created an object to own the array of TWSocket objects.

Now I have a new question that relates to the dependency of the
main form. I'm reusing the sockets. So when a socket is
disconnected, I assign a different IP and connect again. I understand
that I can not do this in the OnSessionClosed event handler (or
that didn't work.) Instead, I need to post a message to the main
form, and reconnect in the windows message handler. This also
introduces a dependency to the main form, and adds and some code
in the main form unit. Is there any other way to defer the call to
the Connect function so that it will happen after the code exits
the OnSessionClosed event handler? I know I can create a hidden
window in the owner object but I would avoid doing that if there
is an easier way.

Best regards,

>> The reason I was thinking of a multi-threaded client is that
>> I want to isolate this module with the main form.

FP> No need to have multithread for that. Just put your TWSocket into a
FP> TDataModule. It's enough.
FP> You can evn create them dynamicall in a pure .pas unit.

FP> fyi: Message handlers can be put everywhere, it doesn't matter.

FP> ----- Original Message ----- 
>> Hello Francois and all,
>> I saw a thread server sample in ICS package but did not
>> see any sample for threaded client. I understand that with
>> ICS I don't have to do multi-threading. The reason I was
>> thinking of a multi-threaded client is that I want to isolate
>> this module with the main form. The module is supposed to
>> create multiple sockets to test a group of servers. I suppose
>> this can be achieved with an array of wsocket objects in a
>> single-threaded application but the socket will have to have
>> something to do with the main form? For example, parent-ed by
>> the main form, or the message handlers defined in the main form.
>> (I could be wrong.) That's why I'm thinking of using a separate
>> group of threads to do the server check. I wonder if there are
>> samples for the client.
>> -- 
>> Best regards,
>> Jack

To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to