redho home | products | services
Web Design Forums

Web Design Forums  


Web Hosting, Web Design, Software and Web Development Forums  
 FAQFAQ   MemberlistArchive  Log inLog in   RegisterRegister 
         

HTTP/1 persistante connections


Goto page 1, 2  Next
 
Post new topic   Reply to topic    Web Design Forums -> JAVA programming forum
View previous topic :: View next topic  
Author Message
Keith Maclaine



Joined: 23 Jun 2006
Posts: 12
Hi everybody , i have one question about HTTP/1.1 persistante connections .. if i have connection to server, the connection is in state open , the server sends me the FIN packet what should i do then ? I mean sending back FIN/ACK is the work of java librarys not ?
  Reply with quote


BigDaddy



Joined: 26 May 2006
Posts: 147
Keith Maclaine, it depends...
do you close the connection?
do you work with sockets or URLConnection?
  Reply with quote
Keith Maclaine



Joined: 23 Jun 2006
Posts: 12
BigDaddy , well i dont close connection after sending some request becouse of this should be persistante conn.
  Reply with quote
BigDaddy



Joined: 26 May 2006
Posts: 147
hard to keep it persistent if the server closes...
but still, are you using sockets or URLConnection
  Reply with quote
Keith Maclaine



Joined: 23 Jun 2006
Posts: 12
yes , sockets
  Reply with quote
BigDaddy



Joined: 26 May 2006
Posts: 147
writing correct http/1.1 socket code is quite hard...
why not use an existing library?
URLConnection uses persistent connections if it can. My proxy does it as well, commons net from apache probably does to
  Reply with quote
Keith Maclaine



Joined: 23 Jun 2006
Posts: 12
well my question is what is has to be done when my app receives for any reason FIN packet from server
  Reply with quote
BigDaddy



Joined: 26 May 2006
Posts: 147
you will get a read() that returns -1 (EOF)
  Reply with quote
Keith Maclaine



Joined: 23 Jun 2006
Posts: 12
BigDaddy, so the solution is to call a read() all the time ?
  Reply with quote
BigDaddy



Joined: 26 May 2006
Posts: 147
no...
are you using blocking io or selector based non-blocking io?
  Reply with quote
Page 1 of 2 Goto page 1, 2  Next
Post new topic   Reply to topic    Web Design Forums -> JAVA programming forum


Dubai Forums - Expat Help | Vegan Chat | Java Programming | Free 3D tutorials and 3d textures | Paris Forum | EU Forum
Free Dubai Classifieds | Free London Classifieds | Jobs in London

High Quality, Custom 3d animation and Web Design solutions Royal Quality Web Hosting Services Vegetarian and Animal Rights news

Powered by phpBB © 2001, 2005 phpBB Group