Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(public socket: dtls.Socket | dgram.Socket) {
super();
this.isDtls = (socket instanceof dtls.Socket);
(socket as any)
.on("message", (message: Buffer, rinfo: dgram.RemoteInfo) => {
this.emit("message", message, rinfo);
})
.on("error", (err: Error) => {
this.emit("error", err);
})
.on("close", () => {
this.emit("close");
})
;
}