let Shinobi manage P2P reconnection

socket.io-v4
Moe 2022-03-21 11:19:05 -07:00
parent c16727e3de
commit 500bd51679
1 changed files with 5 additions and 2 deletions
libs/commander

View File

@ -88,12 +88,15 @@ const initialize = (config,lang) => {
} }
// //
function startBridge(noLog){ function startBridge(noLog){
s.debugLog('p2p',`Connecting to ${selectedHost}...`) console.log('p2p',`Connecting to ${selectedHost}...`)
if(connectionToP2PServer && connectionToP2PServer.connected){ if(connectionToP2PServer && connectionToP2PServer.connected){
connectionToP2PServer.allowDisconnect = true; connectionToP2PServer.allowDisconnect = true;
connectionToP2PServer.disconnect() connectionToP2PServer.disconnect()
} }
connectionToP2PServer = socketIOClient('ws://' + selectedHost, {transports:['websocket']}); connectionToP2PServer = socketIOClient('ws://' + selectedHost, {
transports:['websocket'],
reconnection: false
});
if(!config.p2pApiKey){ if(!config.p2pApiKey){
if(!noLog)s.systemLog('p2p',`Please fill 'p2pApiKey' in your conf.json.`) if(!noLog)s.systemLog('p2p',`Please fill 'p2pApiKey' in your conf.json.`)
} }