@@ -53,9 +53,6 @@ class Server(base_server.BaseServer):
5353 default is `['/']`, which always accepts connections to
5454 the default namespace. Set to `'*'` to accept all
5555 namespaces.
56- :param serializer_args: A mapping of additional parameters to pass to
57- the serializer. The content of this dictionary
58- depends on the selected serialization method.
5956 :param kwargs: Connection parameters for the underlying Engine.IO server.
6057
6158 The Engine.IO configuration supports the following settings:
@@ -404,7 +401,7 @@ def disconnect(self, sid, namespace=None, ignore_queue=False):
404401 if delete_it :
405402 self .logger .info ('Disconnecting %s [%s]' , sid , namespace )
406403 eio_sid = self .manager .pre_disconnect (sid , namespace = namespace )
407- self ._send_packet (eio_sid , self ._create_packet (
404+ self ._send_packet (eio_sid , self .packet_class (
408405 packet .DISCONNECT , namespace = namespace ))
409406 self ._trigger_event ('disconnect' , namespace , sid ,
410407 self .reason .SERVER_DISCONNECT )
@@ -523,13 +520,13 @@ def _handle_connect(self, eio_sid, namespace, data):
523520 or self .namespaces == '*' or namespace in self .namespaces :
524521 sid = self .manager .connect (eio_sid , namespace )
525522 if sid is None :
526- self ._send_packet (eio_sid , self ._create_packet (
523+ self ._send_packet (eio_sid , self .packet_class (
527524 packet .CONNECT_ERROR , data = 'Unable to connect' ,
528525 namespace = namespace ))
529526 return
530527
531528 if self .always_connect :
532- self ._send_packet (eio_sid , self ._create_packet (
529+ self ._send_packet (eio_sid , self .packet_class (
533530 packet .CONNECT , {'sid' : sid }, namespace = namespace ))
534531 fail_reason = exceptions .ConnectionRefusedError ().error_args
535532 try :
@@ -553,15 +550,15 @@ def _handle_connect(self, eio_sid, namespace, data):
553550 if success is False :
554551 if self .always_connect :
555552 self .manager .pre_disconnect (sid , namespace )
556- self ._send_packet (eio_sid , self ._create_packet (
553+ self ._send_packet (eio_sid , self .packet_class (
557554 packet .DISCONNECT , data = fail_reason , namespace = namespace ))
558555 else :
559- self ._send_packet (eio_sid , self ._create_packet (
556+ self ._send_packet (eio_sid , self .packet_class (
560557 packet .CONNECT_ERROR , data = fail_reason ,
561558 namespace = namespace ))
562559 self .manager .disconnect (sid , namespace , ignore_queue = True )
563560 elif not self .always_connect :
564- self ._send_packet (eio_sid , self ._create_packet (
561+ self ._send_packet (eio_sid , self .packet_class (
565562 packet .CONNECT , {'sid' : sid }, namespace = namespace ))
566563
567564 def _handle_disconnect (self , eio_sid , namespace , reason = None ):
@@ -604,7 +601,7 @@ def _handle_event_internal(self, server, sid, eio_sid, data, namespace,
604601 data = list (r )
605602 else :
606603 data = [r ]
607- server ._send_packet (eio_sid , self ._create_packet (
604+ server ._send_packet (eio_sid , self .packet_class (
608605 packet .ACK , namespace = namespace , id = id , data = data ))
609606
610607 def _handle_ack (self , eio_sid , namespace , id , data ):
@@ -653,7 +650,7 @@ def _handle_eio_message(self, eio_sid, data):
653650 else :
654651 self ._handle_ack (eio_sid , pkt .namespace , pkt .id , pkt .data )
655652 else :
656- pkt = self ._create_packet (encoded_packet = data )
653+ pkt = self .packet_class (encoded_packet = data )
657654 if pkt .packet_type == packet .CONNECT :
658655 self ._handle_connect (eio_sid , pkt .namespace , pkt .data )
659656 elif pkt .packet_type == packet .DISCONNECT :
0 commit comments