|
|
|
|
Note:
|
Graphically illustrated:
|
|
|
Operation:
|
if ( write( data ) operation ) { Append data to the TCP send buffer; /* ================================================= Transmit data if buffer exceeds MMS ================================================= */ while ( length(TCP send buffer) ≥ MSS ) { Transmit MSS bytes from send buffer in a TCP segment; Reset TCP transmission timer; } } else if ( push( ) operation ) // C/C++'s flush( ) call { Transmit all data from send buffer in a TCP segment; Reset TCP transmission timer; } else if ( TCP timer expired ) { Transmit all data from send buffer in a TCP segment; Reset TCP transmission timer; } |
|
|
Behavior of the read( N bytes, ...) system call:
if ( length(TCP receive buffer) ≥ N bytes ) { return N bytes to user program; } else { block until TCP receive buffer has ≥ N bytes; } (I.e.: exactly like a pipe) |
|