@@ -26,16 +26,6 @@ class WebSocketServer implements ServerInterface
2626 /** @var LoopInterface */
2727 protected $ loop ;
2828
29- /**
30- * @var string
31- */
32- protected $ host ;
33-
34- /**
35- * @var int
36- */
37- protected $ port ;
38-
3929 /**
4030 * @var \SessionHandler|null
4131 */
@@ -72,8 +62,6 @@ class WebSocketServer implements ServerInterface
7262 protected $ logger ;
7363
7464 /**
75- * @param string $host
76- * @param int $port
7765 * @param EventDispatcherInterface $eventDispatcher
7866 * @param PeriodicRegistry $periodicRegistry
7967 * @param WampApplication $wampApplication
@@ -83,8 +71,6 @@ class WebSocketServer implements ServerInterface
8371 */
8472 public function __construct (
8573 LoopInterface $ loop ,
86- $ host ,
87- $ port ,
8874 EventDispatcherInterface $ eventDispatcher ,
8975 PeriodicRegistry $ periodicRegistry ,
9076 WampApplication $ wampApplication ,
@@ -93,8 +79,6 @@ public function __construct(
9379 LoggerInterface $ logger = null
9480 ) {
9581 $ this ->loop = $ loop ;
96- $ this ->host = $ host ;
97- $ this ->port = $ port ;
9882 $ this ->eventDispatcher = $ eventDispatcher ;
9983 $ this ->periodicRegistry = $ periodicRegistry ;
10084 $ this ->wampApplication = $ wampApplication ;
@@ -117,14 +101,14 @@ public function setSessionHandler(\SessionHandlerInterface $sessionHandler)
117101 *
118102 * @throws \React\Socket\ConnectionException
119103 */
120- public function launch ($ profile )
104+ public function launch ($ host , $ port , $ profile )
121105 {
122106 $ this ->logger ->info ('Starting web socket ' );
123107
124108 $ stack = new Builder ();
125109
126110 $ server = new Server ($ this ->loop );
127- $ server ->listen ($ this -> port , $ this -> host );
111+ $ server ->listen ($ port , $ host );
128112
129113 if (true === $ profile ) {
130114 $ memoryUsagePeriodicTimer = new PeriodicMemoryUsage ($ this ->logger );
@@ -167,21 +151,13 @@ public function launch($profile)
167151 $ this ->logger ->info (sprintf (
168152 'Launching %s on %s PID: %s ' ,
169153 $ this ->getName (),
170- $ this -> getAddress () ,
154+ $ host . ' : ' . $ port ,
171155 getmypid ()
172156 ));
173157
174158 $ app ->run ();
175159 }
176160
177- /**
178- * @return string
179- */
180- public function getAddress ()
181- {
182- return $ this ->host . ': ' . $ this ->port ;
183- }
184-
185161 /**
186162 * @return string
187163 */
0 commit comments