Hi

Well I finally found the error that generates the abnormal behavior in client list.

My service receives some data form a POS machine and then do some work in a DB (SQLServer using ADO). I do all the DB process and validation in a thread and finally I send the results to the POS machine.

It looks like this

1.      Onconnect (SocketServer)
2.      OnDataAvaliable ( if data correct New thread created)
3.      New Thread(  Precess Info)
4.      New thread( PostMesage to send answer)
5.      New Thread(Destroy)
6.      OnClientDisconnect

First mistake: I put TWSocketServer in the service in design time.
       Correct: I Created in OnStart ( Arno suggest this thank you Arno )

Second Mistake: My thread’s create method had this instruction

 begin
    ADOconn := TADOConnection.create( nil )
//This instruction generates the error and freeze the service after some hours running
    …….
End;

Correct: I put my ADOConnection into a DataModule and I create the Datamodule in the Excecute method, not in thread’s create method.

Thank you Wilfried ( you were right about handle overwritten ) , Arno and Francois.


Miguel Angel Cañas C.




From: "Francois Piette" <[EMAIL PROTECTED]>
Reply-To: ICS support mailing <twsocket@elists.org>
To: "ICS support mailing" <twsocket@elists.org>
Subject: Re: [twsocket] TWsocket server client list Error
Date: Wed, 18 Oct 2006 09:07:40 +0200

>I did this in TcpSrv (adding the thread etc ) demo and into a service. The
>demo works fine and no blank ip port connections appeared but the service
>did not work and in some moment did not receive more connections. I still
>have 10038 errors in BgExcep. I already check buffers and all code to avoid
>lose of the handle.

Did you start from the demo service provided with ICS or a brand new one you
created ?
You can email me your /source/ code (no exe please. Just full source to
rebuild quickly and easily your test). I don't promize to have time to look
at it. Il will do if I find some spare time and your code is small and easy
to read.

Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
http://www.overbyte.be

--
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

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

-- 
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