1
This commit is contained in:
parent
d1fab83969
commit
0368ce1295
@ -50,6 +50,8 @@ class ClientSide:
|
||||
data = ''
|
||||
while True:
|
||||
data += yield self.remote_conn.read_message()
|
||||
if not data:
|
||||
continue
|
||||
lines = data.split('\n')
|
||||
if data[-1] == '\n':
|
||||
data = lines[-1]
|
||||
|
@ -50,9 +50,8 @@ class ServerSide:
|
||||
self.remoteConnIdx += 1
|
||||
self.remotePending[conn.idx] = conn
|
||||
conn.localSocket = local_conn
|
||||
print('zzzzzzzz')
|
||||
self.remotePendingMutex.release()
|
||||
local_conn.SendMsg({
|
||||
local_conn.sendMsg({
|
||||
'remoteConnIdx' : conn.idx,
|
||||
'cmd' : 'connect'
|
||||
})
|
||||
@ -92,7 +91,7 @@ class ServerSide:
|
||||
try:
|
||||
if len(self.localHandlerHash) <= 0:
|
||||
return None
|
||||
key = random.choice(list(self.localHanderHash.keys()))
|
||||
key = random.choice(list(self.localHandlerHash.keys()))
|
||||
return self.localHandlerHash[key]
|
||||
finally:
|
||||
self.localHandlerHashMutex.release()
|
||||
@ -159,8 +158,8 @@ class RemoteServer(tornado.tcpserver.TCPServer):
|
||||
if not app.addRemoteConn(conn):
|
||||
stream.close()
|
||||
return
|
||||
await gen.sleep(2)
|
||||
if not app.isConnectOk(conn.connIdx):
|
||||
await tornado.gen.sleep(2)
|
||||
if not app.isConnectOk(conn.idx):
|
||||
stream.close()
|
||||
return
|
||||
await conn.handle_stream()
|
||||
|
Loading…
x
Reference in New Issue
Block a user