?

Log in

No account? Create an account

Previous Entry | Next Entry

Its Raining (or rather Pouring)

Went to college for next to nothing....decided we ( Harry, louiswu, myself, rythm & theju) will give our seminars on the 24 of this month. Now that gives me something like 22 days to prepare for the seminar as well as write the documentation.

Pretty nice day at Sify too. The last two days have been productive. Harry & theju cleaned up GTK code while I was playing with Sockets and HTTP headers which brings me to this doubt... How do you terminate an HTTP connection ? Say I telnet to LJ, I'd do this :

telnet www.livejournal.com 80
GET /users/fox2mike HTTP/1.1
Host:www.livejournal.com


This will get me my Journal. Now how do I do a proper quit ? What is the command or sequence of \r\n if any that signals a disconnect from the server ?

Can't wait to see the Gulf Air Bahrain GP's qualifying session. In other news, Kimi's bad luck continues, which means there may not be the excitement that guys like Kimi can cause in a race... but you never know. New track, New race :) Would be a nice experience.

Comments

( 9 comments — Leave a comment )
rythm
Apr. 2nd, 2004 07:03 pm (UTC)
I am not sure, if we r giving our seminar on 24th. Only u and arun have given the dates, not us. Still have to decide.
fox2mike
Apr. 2nd, 2004 11:56 pm (UTC)
Come on. get it done with!!!
rythm
Apr. 3rd, 2004 07:33 pm (UTC)
Yeah, but maybe not on 24th.
mannu
Apr. 3rd, 2004 02:20 pm (UTC)
I think read returns -1 or 0 or something like that. See the manpage for read. You need to know that the server had disconnected. That's it.
fox2mike
Apr. 3rd, 2004 07:10 pm (UTC)
Umm I don't want the server to disconnect (happens with a timeout), I want my system to signal a terminate/quit to the server & the server then closes the connection.
fox2mike
Apr. 3rd, 2004 07:37 pm (UTC)
I wanted something like KeepAlive 0 I think that'll do the trick fine.
bluesmoon
Apr. 5th, 2004 03:07 am (UTC)
you're looking for:
Connection: close
as your last header

the default for many servers is connection: keep-alive
bluesmoon
Apr. 5th, 2004 03:09 am (UTC)
just to clarify:
persistent connections means that you can send multiple HTTP requests on the same TCP connection. You send the Connection: close header for the last request, and a Connection: keep-alive (just to be sure) for all others.
fox2mike
Apr. 5th, 2004 03:18 am (UTC)
Thanks :) i knew that Keep-Alive was for persistant connections & that simply meant that the server would wait for more requests after serving the first & then time-out if nothing further came in.

Connection:Close does exactly what I needed, thanks again :)

And btw KeepAlive:0 doesn't work the same way on Apache 1.3.x as it does on Apache 2.0.x as in on the 2.0.x KeepAlive:0 terminates the connection as well.

( 9 comments — Leave a comment )

Latest Month

July 2009
S M T W T F S
   1234
567891011
12131415161718
19202122232425
262728293031 

Tags

Powered by LiveJournal.com
Designed by Lilia Ahner