promisfy bind close

http-server
David Kebler 2019-03-17 13:52:58 -07:00
parent 16da37a101
commit b40ed4169f
1 changed files with 2 additions and 0 deletions

View File

@ -1,5 +1,6 @@
import WebSocket from 'ws'
import btc from 'better-try-catch'
import { promisify } from 'util'
import _ON_DEATH from 'death' //this is intentionally ugly
import clone from 'clone'
@ -23,6 +24,7 @@ class Socket extends WebSocket.Server {
//self bindings
this._listen = this._listen.bind(this)
this.create = this.create.bind(this)
this.close = promisify(this.close).bind(this)
log = logger({
file: 'src/socket.js',
class: 'Socket',