in reply to Multi-process Win32 HTTP Daemon
Hint: The code you posted could *never* work.
# Create a client connection object "the hard way" my $c = HTTP::Daemon::ClientConn->new_from_fd( 'STDIN', "+>" );
'STDIN' is just a string no different from 'this' or 'That! or 'Hello world!'.
In particular, it is not the same as the bareword STDIN, which is a pre-opened filehandle, and the what is used in the original code that you downloaded:
# Create a client connection object "the hard way" $c = HTTP::Daemon::ClientConn->new_from_fd(STDIN, "+>");
However, that code doesn't make any sense either, as fdopen take an integer parameter not a filehandle glob, so I do not see how that would ever have worked.
If you change that line to
my $c = HTTP::Daemon::ClientConn->new_from_fd( fileno( STDIN ), '+>' ) +;
The code will work.
c:\test\546536>client Sending request... Got response Content: HTTP/1.1 200 OK <<<<<<<<<<<<<<<<<<<<< **** Note: No EOF *** +** Client-Date: Sun, 30 Apr 2006 18:44:08 GMT Client-Peer: 127.0.0.1:2112 Client-Response-Num: 1 Date: Sun, 30 Apr 2006 18:44:08 GMT Server: libwww-perl-daemon/1.21 **** The content I assume you were expecting, but didn't mention even +when queried. ***** Content-Length: 56 X-Content:: <HTML><B>Pid: 1572</B> Sun Apr 30 19:44:08 2006</HTML> <HTML><B>Pid: 1572</B> Sun Apr 30 19:44:08 2006</HTML>
Free advice:
Got response Content: HTTP/0.9 200 (OK) EOF <<<<<< ******* EOF means End of file ** +*** Client-Date: Sun, 30 Apr 2006 05:50:47 GMT Client-Peer: 127.0.0.1:2112 Client-Response-Num: 1
And that the times being displayed are clearly labelled Client-time:
It's a pretty low trick to just throw the code onto a message board and expect others to sort out your problem.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Multi-process Win32 HTTP Daemon
by rfoskett (Initiate) on Apr 30, 2006 at 19:13 UTC |