• Post Reply Bookmark Topic Watch Topic
  • New Topic

Persistent connection

 
Sri Ram
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to have a persistent connection between a client and server till the clients session ends.
Once the client logs on to the server he should remain connected till he logs off.
The server transmits data using a C socket while the client receives data through java
 
Rishi Singh
Ranch Hand
Posts: 321
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Sri Ram,
For a persistent connection the client and the server must somehow make an understanding between themselves as to when the server's response ends and when the client next request starts.This could be made possible by setting the ContentLength header.The client then knows after that much response it has the control over the socket again.
Inpite of writing the response to the printwriter object you can make use of ByteArrayOutputStream to buffer the output.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!