public function input($buffer, $connection)
    {
        $len = strlen($buffer);
        
        if ($this->max_packet_size >0 && $len >= $this->max_packet_size) {
            throw new \Exception($connection.' request packet size exceed max_packet_size ', Server::ERROR_LARGE_PACKET);
        }
        
        return $len;
    }
public function input($buffer, $connection)
    {
        $len = strlen($buffer);
        
        if ($this->max_packet_size >0 && $len >= $this->max_packet_size) {
            throw new \Exception($connection.' request packet size exceed max_packet_size ', Server::ERROR_LARGE_PACKET);
        }
        
        return $len;
    }
public function input ( $ buffer , $ connection ) { $ len = strlen ( $ buffer ) ; if ( $ this -> max_packet_size > 0 && $ len >= $ this -> max_packet_size ) { throw new \ Exception ( $ connection . ' request packet size exceed max_packet_size ' , Server :: ERROR_LARGE_PACKET ) ; } return $ len ; }
Determines whether the current connection has received the complete packet,
zero value indicates that a complete packet is not received yet,
positive value indicates that a complete packet has been received and represents the number of bytes of the packet,
negative value indicates that the data is invalid or unrecognized

@param string $buffer
@param Connection|StreamClient $connection, for udp packet it is null
@return int
Determines whether the current connection has received the complete packet zero value indicates that a complete packet is not received yet positive value indicates that a complete packet has been received and represents the number of bytes of the packet negative value indicates that the data is invalid or unrecognized