getContents package:network

Receive data from the socket. The socket must be in a connected state. Data is received on demand, in chunks; each chunk will be sized to reflect the amount of data received by individual recv calls. All remaining data from the socket is consumed. When there is no more data to be received, the receiving side of the socket is shut down. If there is an error and an exception is thrown, the socket is not shut down.