| View previous topic :: View next topic |
| Author |
Message |
Tim Robbins Guest
|
Posted: Sun Dec 04, 2005 5:07 pm Post subject: Synapse httpserv demo problem |
|
|
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
|
Posted: Sun Dec 04, 2005 6:57 pm Post subject: Re: Synapse httpserv demo problem |
|
|
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
|
Posted: Sun Dec 04, 2005 7:02 pm Post subject: Re: Synapse httpserv demo problem |
|
|
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
|
Posted: Sun Dec 04, 2005 7:32 pm Post subject: Re: Synapse httpserv demo problem |
|
|
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
|
Posted: Sun Dec 04, 2005 7:35 pm Post subject: Re: Synapse httpserv demo problem |
|
|
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
|
Posted: Mon Dec 05, 2005 2:13 pm Post subject: Re: Synapse httpserv demo problem |
|
|
| 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 |
|
 |
|