ssb-conn-hub
Advanced tools
Comparing version 0.0.9 to 0.0.10
@@ -104,6 +104,6 @@ "use strict"; | ||
this._onRpcConnect = function (rpc, isClient) { | ||
if (!_this._server.ready() && rpc.id !== _this._server.id) | ||
return rpc.close(); | ||
if (rpc.id === _this._server.id) | ||
return; | ||
if (_this._server.ready && !_this._server.ready()) | ||
return rpc.close(); | ||
var peer = _this._getPeerByKey(rpc.id); | ||
@@ -110,0 +110,0 @@ if (!peer) { |
{ | ||
"name": "ssb-conn-hub", | ||
"description": "Module that manages active connections to SSB peers", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"homepage": "https://github.com/staltz/ssb-conn-hub", | ||
@@ -36,2 +36,2 @@ "main": "lib/index.js", | ||
"license": "MIT" | ||
} | ||
} |
# ssb-conn-hub | ||
Module that manages active connections to peers. For use with the SSB CONN family of modules. See also [ssb-conn-db](https://github.com/staltz/ssb-conn-db). | ||
Module that manages active connections to peers. For use with the [SSB CONN](https://github.com/staltz/ssb-conn) family of modules. | ||
@@ -5,0 +5,0 @@ *Visual metaphor: a network switch managing connections to other peers, capable of starting or stopping connections.* |
@@ -104,8 +104,8 @@ import {ConnectionData as Data, ListenEvent, Address} from './types'; | ||
private _onRpcConnect = (rpc: any, isClient: boolean) => { | ||
// If we're not ready, close this connection immediately: | ||
if (!this._server.ready() && rpc.id !== this._server.id) return rpc.close(); | ||
// Don't process self connections, whatever that means: | ||
if (rpc.id === this._server.id) return; | ||
// If ssb-db is (available and) not ready, close this connection ASAP: | ||
if (this._server.ready && !this._server.ready()) return rpc.close(); | ||
const peer = this._getPeerByKey(rpc.id); | ||
@@ -112,0 +112,0 @@ |
113832