Permalink
Browse files

added method Peer.isConnected()

  • Loading branch information...
1 parent 3ebfcab commit bf4e695077bbc5772a77c09beee7e098b0d20600 @MatthiasLohr MatthiasLohr committed Apr 2, 2013
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/peer.js
View
@@ -301,5 +301,13 @@ Peer.prototype.disconnect = function() {
}
};
+/**
+ * Provides a clean method for checking if there's an active connection to the
+ * peer server.
+ */
+Peer.prototype.isConnected = function() {
+ return (!this.disconnected);
+}
+
exports.Peer = Peer;

0 comments on commit bf4e695

Please sign in to comment.