Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/peer.js')
-rw-r--r--lib/peer.js16
1 files changed, 4 insertions, 12 deletions
diff --git a/lib/peer.js b/lib/peer.js
index 5471773..c7da3ad 100644
--- a/lib/peer.js
+++ b/lib/peer.js
@@ -45,34 +45,26 @@ exports.createWebRTCPeer = (conn, swarm) => {
* listening port of the TCP server. Until the remote peer sends a handshake, we don't
* know what swarm the connection is intended for.
*/
-exports.createTCPIncomingPeer = conn => {
- return _createIncomingPeer(conn, 'tcpIncoming')
-}
+exports.createTCPIncomingPeer = conn => _createIncomingPeer(conn, 'tcpIncoming')
/**
* Incoming uTP peers start out connected, because the remote peer connected to the
* listening port of the uTP server. Until the remote peer sends a handshake, we don't
* know what swarm the connection is intended for.
*/
-exports.createUTPIncomingPeer = conn => {
- return _createIncomingPeer(conn, 'utpIncoming')
-}
+exports.createUTPIncomingPeer = conn => _createIncomingPeer(conn, 'utpIncoming')
/**
* Outgoing TCP peers start out with just an IP address. At some point (when there is an
* available connection), the client can attempt to connect to the address.
*/
-exports.createTCPOutgoingPeer = (addr, swarm) => {
- return _createOutgoingPeer(addr, swarm, 'tcpOutgoing')
-}
+exports.createTCPOutgoingPeer = (addr, swarm) => _createOutgoingPeer(addr, swarm, 'tcpOutgoing')
/**
* Outgoing uTP peers start out with just an IP address. At some point (when there is an
* available connection), the client can attempt to connect to the address.
*/
-exports.createUTPOutgoingPeer = (addr, swarm) => {
- return _createOutgoingPeer(addr, swarm, 'utpOutgoing')
-}
+exports.createUTPOutgoingPeer = (addr, swarm) => _createOutgoingPeer(addr, swarm, 'utpOutgoing')
const _createIncomingPeer = (conn, type) => {
const addr = `${conn.remoteAddress}:${conn.remotePort}`