@@ -3,9 +3,9 @@ const EventEmitter = require('events')
33const series = require ( 'run-series' )
44const string2compact = require ( 'string2compact' )
55
6- const attachHttpServer = require ( './services/attachHttp' )
7- const attachUdpServer = require ( './services/attachUdp' )
8- const attachWSServer = require ( './services/attachWS' )
6+ const attachHttpService = require ( './services/attachHttp' )
7+ const attachUdpService = require ( './services/attachUdp' )
8+ const attachWSService = require ( './services/attachWS' )
99const setupStatsRoute = require ( './services/statsRoute' )
1010const common = require ( './lib/common' )
1111const Swarm = require ( './lib/server/swarm' )
@@ -59,9 +59,9 @@ class Server extends EventEmitter {
5959 this . peersCacheLength = peersCacheLength ;
6060 this . peersCacheTtl = peersCacheTtl ;
6161
62- if ( opts . http !== false ) attachHttpServer ( this , onListening ) ;
63- if ( opts . ws !== false ) attachWSServer ( this , onListening ) ;
64- if ( opts . udp !== false ) attachUdpServer ( this , onListening ) ;
62+ if ( opts . http !== false ) attachHttpService ( this , onListening ) ;
63+ if ( opts . ws !== false ) attachWSService ( this , onListening ) ;
64+ if ( opts . udp !== false ) attachUdpService ( this , onListening ) ;
6565 if ( opts . stats !== false ) setupStatsRoute ( this , onListening ) ;
6666
6767 let num = ! ! this . http + ! ! this . udp4 + ! ! this . udp6
@@ -122,7 +122,6 @@ class Server extends EventEmitter {
122122 if ( this . udp6 ) this . udp6 . bind ( udpPort , udp6Hostname )
123123 }
124124
125-
126125 close ( cb ) {
127126 debug ( "close" ) ;
128127
@@ -139,9 +138,9 @@ class Server extends EventEmitter {
139138 }
140139 }
141140
142- [ this . udp4 ,
143- this . udp6 ,
144- this . ws
141+ [ this . udp4 ,
142+ this . udp6 ,
143+ this . ws
145144 ] . forEach ( closeService )
146145
147146 if ( cb ) cb ( null ) ;
0 commit comments