parameters: (self)
return_statement: return retval
docstring: block until messages are read off of socket
          @return: list of newly received messages
          @rtype: [Msg]
          @raise TransportException: if unable to receive message due to error
docstring_summary: block until messages are read off of socket
docstring_tokens: block until messages are read off of socket
function: def receive_once(self):
          """
          block until messages are read off of socket
          @return: list of newly received messages
          @rtype: [Msg]
          @raise TransportException: if unable to receive message due to error
          """
          sock = self.socket
          if sock is None:
              raise TransportException("connection not initialized")
          b = self.read_buff
          msg_queue = []
          p = self.protocol
          try:
              sock.setblocking(1)                
              while not msg_queue and not self.done and not is_shutdown():
                  if b.tell() >= 4:
                      p.read_messages(b, msg_queue, sock) 
                  if not msg_queue:
                      self.stat_bytes += recv_buff(sock, b, p.buff_size)
              self.stat_num_msg += len(msg_queue) #STATS
              # set the _connection_header field
              for m in msg_queue:
                  setattr(m.__class__, '_connection_header', self.header)
                  
              # #1852: keep track of last latched message
              if self.is_latched and msg_queue:
                  self.latch = msg_queue[-1]
              
              return msg_queue
  
          except DeserializationError as e:
              rospyerr(traceback.format_exc())            
              raise TransportException("receive_once[%s]: DeserializationError %s"%(self.name, str(e)))
          except TransportTerminated as e:
              raise #reraise
          except ServiceException as e:
              raise
          except Exception as e:
              rospyerr(traceback.format_exc())
              raise TransportException("receive_once[%s]: unexpected error %s"%(self.name, str(e)))
          return retval
function_tokens: def receive_once ( self ) : sock = self . socket if sock is None : raise TransportException ( "connection not initialized" ) b = self . read_buff msg_queue = [ ] p = self . protocol try : sock . setblocking ( 1 ) while not msg_queue and not self . done and not is_shutdown ( ) : if b . tell ( ) >= 4 : p . read_messages ( b , msg_queue , sock ) if not msg_queue : self . stat_bytes += recv_buff ( sock , b , p . buff_size ) self . stat_num_msg += len ( msg_queue ) #STATS # set the _connection_header field for m in msg_queue : setattr ( m . __class__ , '_connection_header' , self . header ) # #1852: keep track of last latched message if self . is_latched and msg_queue : self . latch = msg_queue [ - 1 ] return msg_queue except DeserializationError as e : rospyerr ( traceback . format_exc ( ) ) raise TransportException ( "receive_once[%s]: DeserializationError %s" % ( self . name , str ( e ) ) ) except TransportTerminated as e : raise #reraise except ServiceException as e : raise except Exception as e : rospyerr ( traceback . format_exc ( ) ) raise TransportException ( "receive_once[%s]: unexpected error %s" % ( self . name , str ( e ) ) ) return retval