• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Flushing the response?

 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

What is actually means by saying the response is comitted?? Does it mean to do os.flush() where os is the outputstream??
 
Saurabh Kumar
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is actually means by saying the response is comitted

this means any response byte have been returned to the client.

Does it mean to do os.flush() where os is the outputstream??

The container buffers the response byte and flushes the buffer if the buffer is full.
calling flush() explicilty flushes the buffer. So, by "commiting the response" either you call flush() or container flushes the buffer when needed.

Thanks and regards,
Saurabh
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I come to know when the buffer size is full and that the container is going to flush the response???
 
Saurabh Kumar
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I come to know when the buffer size is full


I think there is not direct method that can tell you how much the buffer is filled.

However if you are really willing to do it, you can do it this way:
1. get the max size of the buffer by getBufferSize()
2. count each byte you write to response and keep comparing with the buffer size.

that the container is going to flush the response???

I don't think there is any direct way of knowing when container is going to flush the response.

Any such way would be an addition to my knowledge...lets wait for fellow ranchers...

Thanks and regards,
Saurabh
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Saurabh...I think that answerd my point!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic