File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -110,8 +110,10 @@ def fileno(self):
110110 return self .__fileno
111111
112112 def disconnect (self ):
113+ print ("Disconnect request" )
114+ needCallDisconnect = False
113115 if self .__onDisconnected is not None and self .__state != CONNECTION_STATE .DISCONNECTED :
114- self . __onDisconnected ()
116+ needCallDisconnect = True
115117 self .sendRandKey = None
116118 self .recvRandKey = None
117119 if self .__socket is not None :
@@ -123,6 +125,8 @@ def disconnect(self):
123125 self .__writeBuffer = bytes ()
124126 self .__readBuffer = bytes ()
125127 self .__state = CONNECTION_STATE .DISCONNECTED
128+ if needCallDisconnect :
129+ self .__onDisconnected ()
126130
127131 def getSendBufferSize (self ):
128132 return len (self .__writeBuffer )
Original file line number Diff line number Diff line change @@ -265,7 +265,10 @@ def _createServer(self):
265265 host , port = bindAddr .rsplit (':' , 1 )
266266 elif seflAddr is not None :
267267 host , port = seflAddr .rsplit (':' , 1 )
268- host = '0.0.0.0'
268+ if ':' in host :
269+ host = '::'
270+ else :
271+ host = '0.0.0.0'
269272 else :
270273 raise RuntimeError ('Unable to determine bind address' )
271274
Original file line number Diff line number Diff line change @@ -638,6 +638,8 @@ def test_encryptionCorrectPassword():
638638 for conn in list (o1 ._SyncObj__transport ._connections .values ()) + list (o2 ._SyncObj__transport ._connections .values ()):
639639 conn .disconnect ()
640640
641+ doTicks (objs , 10 )
642+
641643 o1 .addValue (100 )
642644
643645 doTicks (objs , 10 , stopFunc = lambda : o1 .getCounter () == 450 and o2 .getCounter () == 450 )
You can’t perform that action at this time.
0 commit comments