I'm not sure I fully understand your program's logic. But instead of the delay, I would use a custom message to queue the request which will be executed cleanly after all current events and subroutines
are done.

Ok, Ill explain better.
There are 3 programs envolved.
1-DataServer (DS)- Talks to database, receiving sql commands from clients and packing and sending back the result (or the succes/failure of the operation) 2-HoldareServer (HS)- A game engine server who listen to clients and use DataServer as well. Here resides the SMTP component
3-HoldareClient (HC)- send requests to HoldareServer.
Lets see a account creation for example:
HC send a account creation command, with a email for key.
HS receive the account creation, and, it is inside the dataavailable event of the socket. It send the sql to insert the account to DS, and must wait for DS answer. Theres a list of all calls to DS (who comes from many different objects) and a callback function is stored in this list to be called when the answer is available. After HS sends the account creation to DS and store his accountcreation callback, it exits the dataavailable event and stay waiting the DS answer or new HC requests, in the mains thread, idle. If a new account creation arrives, the process is repeated and the lists grows waiting for DS. When the answer for accountcreation arrives, the callback function is called - at this point we are inside de ondataavailable of the clientsocket of the DS - and HS will send a email to client informing the first password to login (if all goes right) or sends a message back informing an error (account already existing, for example). This way, some time after (no rules here, can be any time), another thread trigger a message who call itself repeatdly with parameters (0,0,0) until stack overflow. Well, with nothing more to depure, no bugs found anywhere, I decided (one of attempts) to put the SMTP call OUTSIDE the dataavailable event handler. Its working now. What I dont understand here is that the HC and HC arent multi-threaded (DS is) and they are in the same thread all the time... Maybe the messages send by SMTP was put in some different place (there are more than 1 list of messages?) or whatever, dont really know... What I know is that now its working, but I am a bit worried if the problem is resolved... If there are a explanation of what is or what was wrong, Ill sure be more... confortable...
Thanks
Flavio

Rm 12:2 - "E no vos conformeis com este sculo, mas transformai-vos pela renovao da vossa mente, para que experimenteis qual seja a boa, agradvel e perfeita vontade de Deus."

----- Original Message ----- From: "Francois Piette" <[EMAIL PROTECTED]>
To: "ICS support mailing" <twsocket@elists.org>
Sent: Tuesday, June 14, 2005 3:41 AM
Subject: Re: [twsocket] SMTPCli within a NT service - stack overflow


client socket event) and then start de connect of the smtp, but,
the other commands of the smtp occurs out of the event of the
socket client. I put a delayed call to the smtp.connect (to
occurs outside the event) and...magic! works...
well, dont understand why, anyway, I will test more, but
its working now...

I'm not sure I fully understand your program's logic. But instead of the delay, I would use a custom message to queue the request which will be executed cleanly after all current events and subroutines
are done.
--
[EMAIL PROTECTED]
http://www.overbyte.be

----- Original Message ----- From: "Moacir Flvio Gonalves" <[EMAIL PROTECTED]>
To: "ICS support mailing" <twsocket@elists.org>
Sent: Monday, June 13, 2005 11:13 PM
Subject: Re: [twsocket] SMTPCli within a NT service - stack overflow


Well, I think I found the problem. When I write a small application it works
fine. But in my software it isnt...
The app is a server and have a listening socket, a client socket and a smtp
client. When a client of the app
send a message, the app sends a request of data to another app (data base)
and saves a callback function
for answer de client when DB answers... When DB answer, the app call the
callback function (inside the
client socket event) and then start de connect of the smtp, but, the other
commands of the smtp occurs out
of the event of the socket client. I put a delayed call to the smtp.connect
(to occurs outside the event) and...
magic! works... well, dont understand why, anyway, I will test more, but
its working now...
Flavio

Rm 12:2 - "E no vos conformeis com este sculo, mas transformai-vos pela
renovao da vossa mente, para que experimenteis qual seja a boa, agradvel
e perfeita vontade de Deus."

----- Original Message ----- From: "Moacir Flvio Gonalves" <[EMAIL PROTECTED]>
To: "ICS support mailing" <twsocket@elists.org>
Sent: Monday, June 13, 2005 1:17 PM
Subject: Re: [twsocket] SMTPCli within a NT service - stack overflow


> Good! I will, but, meanwhile, I use delphi 7, no update...
> Ill make a version available
> Thanks
> Flavio
>
> Rm 12:2 - "E no vos conformeis com este sculo, mas transformai-vos > pela
> renovao da vossa mente, para que experimenteis qual seja a boa,
> agradvel e perfeita vontade de Deus."
>
> ----- Original Message ----- > From: "Francois PIETTE" <[EMAIL PROTECTED]>
> To: "ICS support mailing" <twsocket@elists.org>
> Sent: Monday, June 13, 2005 1:00 PM
> Subject: Re: [twsocket] SMTPCli within a NT service - stack overflow
>
>
> No idea.
> Can you write a very small test program that reproduce your problem ?
> btw: I use SMTP in service apps without any problem.
>
> --
> [EMAIL PROTECTED]
> http://www.overbyte.be
>
> ----- Original Message ----- > From: "Moacir Flvio Gonalves" <[EMAIL PROTECTED]>
> To: <twsocket@elists.org>
> Sent: Monday, June 13, 2005 1:42 PM
> Subject: [twsocket] SMTPCli within a NT service - stack overflow
>
>
>> The HTTPCli 401 problem (triggered twice is resolved, thanks a lot)...
>> Now I'm experiencing another "problem" with a SMTP. It's inside a NT
>> service.
>> The problem occurs after I send any email, in another thread then the
>> current one. It's like if a message was sent but with any kind of
>> problem,
>> because the thread goes stack overflow, calling again and again with
>> parameters 0,0,0 (have look at the call stack), like if a message >> "nil"
>> or some
>> kind of was sent, don't know; I do not get when its triggered yet...
>> but I'm looking into... Im thinking its about the WndProc of the
>> SMTPCli,
>> because the problem trigger only after I send a email
>> Someone has a clue?
>>
>> Flavio
>>
>>
>>
>> Rm 12:2 - "E no vos conformeis com este sculo, mas transformai-vos >> pela
>> renovao da vossa mente, para que experimenteis qual seja a boa,
>> agradvel e perfeita vontade de Deus."
>> -- >> 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
>>
>
>
> -- > 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
>
>
>
> -- > 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
>
>


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



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




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