I am testing a simple TCP server/client app using the Network support on mac os x. It basically works well except when the server sends a lot of data (definition of "a lot" is that the amount of data exceeds the maximumLength value in the connection.receive call). In this case the client will receive multiple segments (each of which has less than or equal maximumLength value). For example if the maximumLength is set to 30000 and the server sends 100000 bytes, the client receive loop will get around 4 segments each of which has length <= 30000.
My question is: is there some information that the client can examine from the connection after a receive to determine that more data is available?