more socket.io things.
This commit is contained in:
parent
0e31719d13
commit
b7bc1cfe77
@ -140,7 +140,7 @@ HTTPClient.prototype.listenWallet = function listenWallet(id) {
|
||||
if (!this.socket)
|
||||
return;
|
||||
|
||||
this.socket.join(id);
|
||||
this.socket.emit('join', id);
|
||||
};
|
||||
|
||||
/**
|
||||
@ -152,7 +152,7 @@ HTTPClient.prototype.unlistenWallet = function unlistenWallet(id) {
|
||||
if (!this.socket)
|
||||
return;
|
||||
|
||||
this.socket.leave(id);
|
||||
this.socket.emit('leave', id);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@ -663,6 +663,14 @@ HTTPServer.prototype._initIO = function _initIO() {
|
||||
self.emit('error', err);
|
||||
});
|
||||
|
||||
socket.on('join', function(id) {
|
||||
socket.join(id);
|
||||
});
|
||||
|
||||
socket.on('leave', function(id) {
|
||||
socket.leave(id);
|
||||
});
|
||||
|
||||
self.emit('websocket', socket);
|
||||
|
||||
socket.emit('version', {
|
||||
@ -771,7 +779,7 @@ HTTPServer.prototype.listen = function listen(port, host, callback) {
|
||||
return self.emit('error', err);
|
||||
}
|
||||
|
||||
bcoin.debug('Listening - host=%s port=%d',
|
||||
bcoin.debug('HTTP server listening on %s (port=%d).',
|
||||
address.address, address.port);
|
||||
|
||||
self.loaded = true;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user