#NEWLINE# def recv_msg( sock ) : #NEWLINE# #INDENT# 'Receives a method and message from the socket.  This function blocks the\n    current thread.\n    ' #NEWLINE# data = recv ( sock , struct . calcsize ( METHOD_STRUCT_FORMAT ) ) #NEWLINE# ( method , ) = struct . unpack ( METHOD_STRUCT_FORMAT , data ) #NEWLINE# data = recv ( sock , struct . calcsize ( SIZE_STRUCT_FORMAT ) ) #NEWLINE# ( size , ) = struct . unpack ( SIZE_STRUCT_FORMAT , data ) #NEWLINE# data = recv ( sock , size ) #NEWLINE# msg = pickle . loads ( data ) #NEWLINE# return ( method , size )