Move connection logic into connection class

- Moved everything I could into the class itself.
- Improve the logging situation a bit.
- Switch some trace logs to debug.
- Get debug port from message arguments.
This commit is contained in:
Asher
2021-04-20 11:17:18 -05:00
parent ae6089f852
commit f0bafa387f
4 changed files with 110 additions and 79 deletions

View File

@@ -130,12 +130,12 @@ export class Protocol extends PersistentProtocol {
}
/**
* Get inflateBytes in base64 format from the current socket.
* Get inflateBytes from the current socket.
*/
public get inflateBytes(): string | undefined {
public get inflateBytes(): Uint8Array | undefined {
const socket = this.getSocket();
return socket instanceof WebSocketNodeSocket
? Buffer.from(socket.recordedInflateBytes.buffer).toString('base64')
? socket.recordedInflateBytes.buffer
: undefined;
}
}