mirror of
https://github.com/leon-ai/leon.git
synced 2025-01-04 15:55:58 +03:00
fix(server): reset connection state and connection counter
This commit is contained in:
parent
862112ed5f
commit
3d9d9496b7
@ -44,6 +44,7 @@ class TCPClient {
|
||||
`Connected to the TCP server tcp://${this.host}:${this.port}`
|
||||
)
|
||||
|
||||
this.reconnectCounter = 0
|
||||
this.isConnected = true
|
||||
this.ee.emit('connected', null)
|
||||
})
|
||||
@ -87,11 +88,15 @@ class TCPClient {
|
||||
} else {
|
||||
LogHelper.error(`Failed to connect to the TCP server: ${err}`)
|
||||
}
|
||||
|
||||
this.isConnected = false
|
||||
})
|
||||
|
||||
this.tcpSocket.on('end', () => {
|
||||
LogHelper.title('TCP Client')
|
||||
LogHelper.success('Disconnected from the TCP server')
|
||||
|
||||
this.isConnected = false
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user