@@ -89,7 +89,7 @@ def __init__(self, client_manager=None, logger=False, binary=False,
89
89
self .handlers = {}
90
90
self .namespace_handlers = {}
91
91
92
- self ._binary_packet = []
92
+ self ._binary_packet = {}
93
93
94
94
if not isinstance (logger , bool ):
95
95
self .logger = logger
@@ -491,10 +491,10 @@ def _handle_eio_connect(self, sid, environ):
491
491
492
492
def _handle_eio_message (self , sid , data ):
493
493
"""Dispatch Engine.IO messages."""
494
- if len ( self ._binary_packet ) :
495
- pkt = self ._binary_packet [0 ]
494
+ if sid in self ._binary_packet :
495
+ pkt = self ._binary_packet [sid ]
496
496
if pkt .add_attachment (data ):
497
- self ._binary_packet . pop ( 0 )
497
+ del self ._binary_packet [ sid ]
498
498
if pkt .packet_type == packet .BINARY_EVENT :
499
499
self ._handle_event (sid , pkt .namespace , pkt .id , pkt .data )
500
500
else :
@@ -511,7 +511,7 @@ def _handle_eio_message(self, sid, data):
511
511
self ._handle_ack (sid , pkt .namespace , pkt .id , pkt .data )
512
512
elif pkt .packet_type == packet .BINARY_EVENT or \
513
513
pkt .packet_type == packet .BINARY_ACK :
514
- self ._binary_packet . append ( pkt )
514
+ self ._binary_packet [ sid ] = pkt
515
515
elif pkt .packet_type == packet .ERROR :
516
516
raise ValueError ('Unexpected ERROR packet.' )
517
517
else :
0 commit comments