parameters: (self)
docstring: Writes the TCPROS header to the active connection.
docstring_summary: Writes the TCPROS header to the active connection.
docstring_tokens: Writes the TCPROS header to the active connection .
function: def write_header(self):
          """Writes the TCPROS header to the active connection."""
          # socket may still be getting spun up, so wait for it to be writable
          sock = self.socket
          protocol = self.protocol
          # race condition on close, better fix is to pass these in,
          # functional style, but right now trying to cause minimal
          # perturbance to codebase.
          if sock is None or protocol is None:
              return
          fileno = sock.fileno()
          ready = None
          while not ready:
              _, ready, _ = select.select([], [fileno], [])
          logger.debug("[%s]: writing header", self.name)
          sock.setblocking(1)
          self.stat_bytes += write_ros_handshake_header(sock, protocol.get_header_fields())
function_tokens: def write_header ( self ) : # socket may still be getting spun up, so wait for it to be writable sock = self . socket protocol = self . protocol # race condition on close, better fix is to pass these in, # functional style, but right now trying to cause minimal # perturbance to codebase. if sock is None or protocol is None : return fileno = sock . fileno ( ) ready = None while not ready : _ , ready , _ = select . select ( [ ] , [ fileno ] , [ ] ) logger . debug ( "[%s]: writing header" , self . name ) sock . setblocking ( 1 ) self . stat_bytes += write_ros_handshake_header ( sock , protocol . get_header_fields ( ) )