Markus Humm wrote:
> Hello,
> 
> I tried the direct calling of the timer without succes (I think some
> of the affected VCL-components [like ListView and JvSimScope from
> JEDI] need windows messages for their updating as well).
> 
> I also tried the thread based approach but without success. If I pack
> the ICS communication into a thread I can connect but the rest doesn't
> work. The thread looks like this:

Please show us some code from your OnSessionAvailable handler.
Also have a look at OnSessionAvailable of TWSocketServer.
 
> - create which sets FreeOnTerminate and starts the thread
> - execute which sets up a TWSocket as TCP-Server with
>   multithreaded:=true
> - in the OnSessionAvailable of that TWSocket another one is created
> with   multithreaded:=true as well and the connection is handed over

Why don't you use TWSocketServer or a modified TWSocketServer?
Makes life much easier.

> (just   reused the code which wasn't in the thread before and worked
> before   packing it in the thread, but with a bad resonding GUI)
> - in the execute I have a loop like this after creating the
>   server socket:
> 
>   while not terminated do
>   begin
>     GetMessage(msg, 0, 0, 0);
> 
>     if msg.message = wm_mythreadquit then break;
> 
>     TranslateMessage(msg);
>     DispatchMessage(msg);
>   end;

That's OK, but you should also check result of GetMessage() which would
be FALSE in case of message WM_QUIT. 

> 
> - the thread has a overriden Terminate which
>   PostThreadMessage(self.threadid, wm_mythreadquit);
> 
> Terminating the thread works well but all ICS communication
> doesn't work.
> 
> Sending calls via the socket are done from outside the
> thread's context and are embedded in other threads, but I
> don't get a crash,

Socket exceptions are silent if the application is not run in
the debugger and OnBgException is not assigned.

---
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html


> so that's no problem except it simply
> doesn't send...
> 
> What's wrong here?
> 
> Greetings
> 
> Markus
-- 
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