> Well I know from the basics of TCP/IP that by default protocol will
> buffer the application data to reduce the high overhead that occurs in
[quoted text clipped - 6 lines]
> I am not sure how this can be done in JAVA. Would be very interested to
> know.
I was pointing to this feature of TCP / IP because I was thinking that
the message stream that the program is sending might be broken due to
the above mentioned feature.
Can someone tell me if that wouldnt happen here.
Would this feature make sure that the data that is being buffered will
not be broken, which would make the recieving program interpret
differently.
Thomas Weidenfeller - 13 Jan 2006 08:58 GMT
> I was pointing to this feature of TCP / IP because I was thinking that
> the message stream that the program is sending might be broken due to
> the above mentioned feature.
The data stream is "never" broken (cutting the wire would of course
break it). Any TCP application that assumes a fixed record size by
assuming "one segment == one record" is broken. Badly. TCP is a
streaming protocol and pushing a TCP segment does not change this. Your
receiving side has to be aware that it gets a data stream, always. And
the application software has, if desired, to separate the stream into
records or messages, or whatever, using higher layer protocols, above TCP.
Take HTTP (which runs on top of TCP) for example. It applies multiple
techniques to separate the data "records" in a message. Headers and body
are separated by an empty line (two CR/LF). Each header line is
terminated with a single CR/LF. A header identifies the body length, or
the message is marked as complete by simply closing the connection.
> Can someone tell me if that wouldnt happen here.
> Would this feature make sure that the data that is being buffered will
> not be broken, which would make the recieving program interpret
> differently.
The only thing that is broken would be an application which relies on
particular segment sizes.
/Thomas

Signature
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/
EJP - 15 Jan 2006 09:25 GMT
>>But there is a way this can be handled, that is using the push
>>operation that an application program can use to force delivery of data
[quoted text clipped - 7 lines]
> the above mentioned feature.
> Can someone tell me if that wouldnt happen here.
There is not and has never been a way for the application to set the
PUSH flag in TCP/IP, not in BSD sockets, WINSOCK, Java, or any other
TCP/IP implementation I am aware of.