Buffering Network Connections
I am building two applications (well, one application and one applet) that communicate over a network using TCP. The application, which is the server, is continually spitting out data from a sensor every 10 ms. The applet is receiving these data by reading through a buffered reader and graphing them. The whole point of this is to get a "real-time" glimpse of the data that the sensor is recording. However, the applet also supports "pausing," in that the applet will stop reading from the network connection and will stop graphing, but will allow the user to interact with the graph. The way it is implemented is the simplest. I know that it is simple, but I am concerned that the SO_RCVBUF (and or the buffer of the buffered reader) will fill up if the user keeps the graph paused for a long time.
Basically, I want to know what happens to the data when these buffers are full? More specifically:
1) Will the bufferedreader always read data into its buffer, even if the buffer is full and it has to overwrite data)?
2) If the SO_RCVBUF is full, will TCP send an error packet to the server? Will it just overwrite the buffer?
3) Is it OK for the buffers to be full (and/or "overflow" in the sense that the amount of data to be stored in the buffer is greater than the size of the buffer, not the security vulnerability sense)? I do not care if some data gets thrown away, I just want to know if java, TCP or the server will complain if this happens.
I can post code if it is necessary, but I can't think of what code to post in relation to my question.
Thanks,
geffde

