BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Synapse httpserv demo problem

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock
View previous topic :: View next topic  
Author Message
Tim Robbins
Guest





PostPosted: Sun Dec 04, 2005 5:07 pm    Post subject: Synapse httpserv demo problem Reply with quote



Hi,

I'm taking my first looks at the Synapse library. I've downloaded the
latest version. Unfortunately, the httpserv demo crashes immediately
under D7. I don't think that there's much I could have done wrong.

Although the echo server demo runs just fine, the http server seems to
have a thread problem:

---------------------------
Debugger Exception Notification
---------------------------
Project httpserv.exe raised exception class EThread with message
'Thread Error: The handle is invalid (6)'. Process stopped. Use Step or
Run to continue.
---------------------------

Can anyone advise a solution? Thank you.
Back to top
theo
Guest





PostPosted: Sun Dec 04, 2005 6:57 pm    Post subject: Re: Synapse httpserv demo problem Reply with quote



Tim Robbins schrieb:
Quote:
Hi,

I'm taking my first looks at the Synapse library. I've downloaded the
latest version. Unfortunately, the httpserv demo crashes immediately
under D7. I don't think that there's much I could have done wrong.

Although the echo server demo runs just fine, the http server seems to
have a thread problem:

---------------------------
Debugger Exception Notification
---------------------------
Project httpserv.exe raised exception class EThread with message
'Thread Error: The handle is invalid (6)'. Process stopped. Use Step or
Run to continue.
---------------------------

Can anyone advise a solution? Thank you.


http://sourceforge.net/mailarchive/message.php?msg_id=13678287

Back to top
Tim Robbins
Guest





PostPosted: Sun Dec 04, 2005 7:02 pm    Post subject: Re: Synapse httpserv demo problem Reply with quote



Thank you Theo, but that still doesn't work. Although it doesn't
*immediately* crash, it crashes the very first time the program tries
to "serve" anything (to a browser...) with the very same error.

In fact, the first thing I tried when I saw it crash was to move the
inherited constructor call to the beginning of this constructor, EVEN
though I was concerned about the fact that it was starting the thread
immediately.

The second thing I tried was to call inherited, but suspended, and
Resume() at the end of the constructor. Also no good.

It seems very strange that an important demo for a package would be
left in such a state...
Back to top
Tim Robbins
Guest





PostPosted: Sun Dec 04, 2005 7:32 pm    Post subject: Re: Synapse httpserv demo problem Reply with quote

I guess I should have looked just a little further: both the listening
thread and the client threads have the same inherited call problem in
the constructors... One's faith is shaken right from the start...
Back to top
Tim Robbins
Guest





PostPosted: Sun Dec 04, 2005 7:35 pm    Post subject: Re: Synapse httpserv demo problem Reply with quote

In case anyone else is interested... (this code runs, but is otherwise
"unchecked"), here are the two routines I changed, in the http unit of
the httpserv demo program:

Constructor TTCPHttpDaemon.Create;
begin
inherited create(true);
sock:=TTCPBlockSocket.create;
FreeOnTerminate:=true;
Priority:=tpNormal;
Resume;
end;

....

{ TTCPHttpThrd }

Constructor TTCPHttpThrd.Create(Hsock:TSocket);
begin
inherited create(true);
sock:=TTCPBlockSocket.create;
Headers := TStringList.Create;
InputData := TMemoryStream.Create;
OutputData := TMemoryStream.Create;
Sock.socket:=HSock;
FreeOnTerminate:=true;
Priority:=tpNormal;
Resume;
end;
Back to top
Francois Piette [ICS & Mi
Guest





PostPosted: Mon Dec 05, 2005 2:13 pm    Post subject: Re: Synapse httpserv demo problem Reply with quote

Quote:
I'm taking my first looks at the Synapse library. I've downloaded the
latest version. Unfortunately, the httpserv demo crashes immediately
under D7. I don't think that there's much I could have done wrong.

Give a try to Indy or ICS. Both are free and include full source code.
Indy: http://www.indyproject.org/
ICS: http://www.overbyte.be

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




Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.