Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Recieve Buffer VS Buffereing the Stream

 
Costa Lamona
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

When you have a socket, and you want to buffer incoming or outgoing data,
should I call

Socket.setReceiveBufferSize

or wrap the InputStream int BufferedStream.

also what is the following sentence from the javadoc of Socket.setReceiveBufferSize means?
"while decreasing it can help reduce the backlog of incoming data"

what is backlog ?

Thanks
 
Joe Ess
Bartender
Posts: 9362
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A backlog is a list of things that need to be done.
I suppose the statement you quote indicates that too large of a receive buffer will cause a problem because the socket tries to fill the receive buffer before handing the data to the interested party (in this case the JVM Socket implementation).
Personally, I usually use buffered streams with sockets, and that has worked Good Enough. Maybe someone with experience with socket tuning can chime in.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!