Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_onReceive(request, peer) {
let endpoint = this.endpoints[peer];
if (request.type == Type.Ack || request.type == Type.Rst) {
if (endpoint) {
endpoint.dequeue(request);
}
} else {
if (!endpoint) {
endpoint = this.endpoints[peer] = new this.Endpoint(
peer,
this.transport,
(err, msg) => this.handleError(err, msg)
);
}
let session = this._findOrCreateSession(request, endpoint);
this._runSession(session);
}
}