Re: linux socket programming and HTTP Protocol Problem
- From: "David Schwartz" <davids@xxxxxxxxxxxxx>
- Date: 17 Aug 2006 17:27:26 -0700
Paul Hulme wrote:
send(clntSocket, "HTTP/1.1 200 OK\n", 16, 0);
You mean \r\n
Why are you claiming HTTP/1.1 compatability? Try HTTP/1.0
send(clntSocket, "Content-type: text/html\n", 25, 0);
Same thing.
send(clntSocket, "Content-length:\n\n", 18, 0); //extra line feed for
http spec
//html code
Why are you sending an *empty* content length header? If you aren't
going to send the length, don't send this header.
And you need \r\n\r\n to separate the headers from the data.
this is just to test the socket connection. The problem is, i try to
use internet explorer or firefox to connect to the server and retrieve
this test page. Both web browsers connect to the server but both fail
to load the page. Internet explorer complains that it cannot find
server. and firefox says that the connection was reset before the page
could be loaded. The thing is though, if i use wget to connect to the
You are waiting for their complete query right? Otherwise, you may be
closing the connection before they've even *sent* their query.
DS
.
- References:
- linux socket programming and HTTP Protocol Problem
- From: Paul Hulme
- linux socket programming and HTTP Protocol Problem
- Prev by Date: Re: Shared memory question
- Next by Date: Re: Obtaining a stack trace from a core dump
- Previous by thread: Re: linux socket programming and HTTP Protocol Problem
- Next by thread: Re: linux socket programming and HTTP Protocol Problem
- Index(es):
Relevant Pages
|