def socket_read(fp):
response = '<STR_LIT>'<EOL>oldlen = <NUM_LIT:0><EOL>newlen = <NUM_LIT:0><EOL>while True:<EOL><INDENT>response += fp.read(buffSize)<EOL>newlen = len(response)<EOL>if newlen - oldlen == <NUM_LIT:0>:<EOL><INDENT>break<EOL><DEDENT>else:<EOL><INDENT>oldlen = newlen<EOL><DEDENT><DEDENT>return response<EOL>
Buffered read from socket. Reads all data available from socket.

    @fp:     File pointer for socket.
    @return: String of characters read from buffer.