File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -108,8 +108,10 @@ def fileno(self):
108108 return self .__fileno
109109
110110 def disconnect (self ):
111+ print ("Disconnect request" )
112+ needCallDisconnect = False
111113 if self .__onDisconnected is not None and self .__state != CONNECTION_STATE .DISCONNECTED :
112- self . __onDisconnected ()
114+ needCallDisconnect = True
113115 self .sendRandKey = None
114116 self .recvRandKey = None
115117 if self .__socket is not None :
@@ -121,6 +123,8 @@ def disconnect(self):
121123 self .__writeBuffer = bytes ()
122124 self .__readBuffer = bytes ()
123125 self .__state = CONNECTION_STATE .DISCONNECTED
126+ if needCallDisconnect :
127+ self .__onDisconnected ()
124128
125129 def getSendBufferSize (self ):
126130 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