send P2pAlive if havent heard from the other side for 500ms
This commit is contained in:
@@ -12,6 +12,7 @@ export type Session = {
|
||||
ticket: number[];
|
||||
eventEmitter: EventEmitter;
|
||||
dst_ip: string;
|
||||
lastReceivedPacket: number;
|
||||
};
|
||||
|
||||
export type PacketHandler = (session: Session, dv: DataView, rinfo: RemoteInfo) => void;
|
||||
@@ -49,6 +50,7 @@ export const makeSession = (cb: msgCb, connCb: connCb, options: opt): Session =>
|
||||
const session: Session = {
|
||||
outgoingCommandId: 0,
|
||||
ticket: [0, 0, 0, 0],
|
||||
lastReceivedPacket: 0,
|
||||
eventEmitter: new EventEmitter(),
|
||||
send: (msg: DataView) => {
|
||||
const raw = msg.readU16();
|
||||
|
||||
Reference in New Issue
Block a user