(self, bytes)
return True
Takes some bytes and process them through the
        internal stream's parser. If a message of any kind is
        found, performs one of these actions:

        * A closing message will initiate the closing handshake
        * Errors will initiate a closing handshake
        * A message will be passed to the ``received_message`` method
        * Pings will see pongs be sent automatically
        * Pongs will be passed to the ``ponged`` method

        The process should be terminated when this method
        returns ``False``.
Takes some bytes and process them through the
        internal stream's parser. If a message of any kind is
        found, performs one of these actions:
Takes some bytes and process them through the internal stream s parser . If a message of any kind is found performs one of these actions :
def process(self, bytes):
        """ Takes some bytes and process them through the
        internal stream's parser. If a message of any kind is
        found, performs one of these actions:

        * A closing message will initiate the closing handshake
        * Errors will initiate a closing handshake
        * A message will be passed to the ``received_message`` method
        * Pings will see pongs be sent automatically
        * Pongs will be passed to the ``ponged`` method

        The process should be terminated when this method
        returns ``False``.
        """
        s = self.stream

        if not bytes and self.reading_buffer_size > 0:
            return False

        self.reading_buffer_size = s.parser.send(bytes) or DEFAULT_READING_SIZE

        if s.closing is not None:
            logger.debug("Closing message received (%d) '%s'" % (s.closing.code, s.closing.reason))
            if not self.server_terminated:
                self.close(s.closing.code, s.closing.reason)
            else:
                self.client_terminated = True
            s = None
            return False

        if s.errors:
            for error in s.errors:
                logger.debug("Error message received (%d) '%s'" % (error.code, error.reason))
                self.close(error.code, error.reason)
            s.errors = []
            s = None
            return False

        if s.has_message:
            self.received_message(s.message)
            if s.message is not None:
                s.message.data = None
                s.message = None
            s = None
            return True

        if s.pings:
            for ping in s.pings:
                self.sock.sendall(s.pong(ping.data))
            s.pings = []

        if s.pongs:
            for pong in s.pongs:
                self.ponged(pong)
            s.pongs = []

        s = None
        return True
def process ( self , bytes ) : s = self . stream if not bytes and self . reading_buffer_size > 0 : return False self . reading_buffer_size = s . parser . send ( bytes ) or DEFAULT_READING_SIZE if s . closing is not None : logger . debug ( "Closing message received (%d) '%s'" % ( s . closing . code , s . closing . reason ) ) if not self . server_terminated : self . close ( s . closing . code , s . closing . reason ) else : self . client_terminated = True s = None return False if s . errors : for error in s . errors : logger . debug ( "Error message received (%d) '%s'" % ( error . code , error . reason ) ) self . close ( error . code , error . reason ) s . errors = [ ] s = None return False if s . has_message : self . received_message ( s . message ) if s . message is not None : s . message . data = None s . message = None s = None return True if s . pings : for ping in s . pings : self . sock . sendall ( s . pong ( ping . data ) ) s . pings = [ ] if s . pongs : for pong in s . pongs : self . ponged ( pong ) s . pongs = [ ] s = None return True