why am i receiving a string from the socket until the \n newline escape sequence in python?,socket.close()