@@ -9,15 +9,14 @@ public function __construct() {
99 $ snew  React \Socket \Server ($ l
1010 $ son ('connection ' , function  ($ cuse  ($ l
1111 if  (($ ocount ($ this o ))<9999 ) {
12-  $ cl  = $ l
1312 $ cp  = NULL ;
1413 $ cu  = new  U ();
1514 $ this o [$ ck =(int )$ cstream ] = $ c
1615 $ con ('close ' , function  ($ c
1716 $ this k ($ ck , $ c'gone ' );
1817 });
19-  $ con ('data ' , function  ($ d$ c
20-  $ this x ($ d$ c
18+  $ con ('data ' , function  ($ d$ cuse  ( $ l )  {
19+  $ this x ($ d$ c,  $ l 
2120 });
2221 $ this l ('connected, total:  ' .($ o1 ).'. ' );
2322 } else  {
@@ -28,10 +27,9 @@ public function __construct() {
2827 $ slisten (3333 , 0 );
2928 $ wnew  React \Socket \Server ($ l
3029 $ won ('connection ' , function  ($ cuse  ($ l
31-  $ cl  = $ l
32-  $ con ('data ' , function  ($ d$ c
30+  $ con ('data ' , function  ($ d$ cuse  ($ l
3331 if  ($ cgetRemoteAddress ()=='127.0.0.1 ' )
34-  $ this h ($ d$ c
32+  $ this h ($ d$ c,  $ l 
3533 $ cend ();
3634 });
3735 });
@@ -40,7 +38,7 @@ public function __construct() {
4038 $ lrun ();
4139 }
4240
43-  private  function  x ($ _d$ c
41+  private  function  x ($ _d$ c,  $ l 
4442 $ _d$ cu ->d ($ _d
4543 if  ($ _dFALSE  || !($ djson_decode ($ _dTRUE ))) $ this k ($ ck , $ c'lost ' );
4644 else  {
@@ -58,7 +56,7 @@ private function x($_d, $c) {
5856 $ cwrite ('{"error":null,"id": ' .$ d'id ' ].',"result":true} ' ."\n" );
5957 if  (isset ($ d'params ' ]) && isset ($ d'params ' ][0 ]) && $ d'params ' ][0 ]) {
6058 $ cu ->u  = $ d'params ' ][0 ];
61-  $ this c ($ c
59+  $ this c ($ l ,  $ c
6260 } else  $ this k ($ ck , $ c'unkown ' );
6361 } else  if  ($ cp ) {
6462 if (isset ($ d'method ' ]) && $ d'method ' ]=='mining.submit '  && isset ($ d'params ' ]) && isset ($ d'params ' ][0 ]) and  $ d'params ' ][0 ]==$ cu ->P ['user ' ])
@@ -70,14 +68,14 @@ private function x($_d, $c) {
7068 }
7169 }
7270
73-  private  function  c ($ c$ o0 ) {
71+  private  function  c ($ l ,  $ c$ o0 ) {
7472 if  ($ cp ) $ cp ->end ();
7573 $ cp  = NULL ;
7674 $ a$ cu ->c ();
7775 $ cu ->P  = $ a$ o
7876 $ nisset ($ a$ o1 ]) ? $ o1  : 0 ;
7977 $ xnew  React \Dns \Resolver \Factory ();
80-  $ _cnew  React \SocketClient \Connector ($ c -> l , $ xcreateCached ('8.8.8.8 ' , $ c -> l ));
78+  $ _cnew  React \SocketClient \Connector ($ l$ xcreateCached ('8.8.8.8 ' , $ l
8179 $ _ccreate ($ cu ->P ['url ' ], $ cu ->P ['port ' ])->then (function  ($ suse  ($ c
8280 $ cp  = $ s
8381 if  ($ cu ->s ) {
@@ -109,8 +107,8 @@ private function c($c, $o = 0) {
109107 } else  $ this k ($ ck , $ c'lost before server ' );
110108 });
111109 } else  $ this k ($ ck , $ c'miss subscribe ' );
112-  }, function () use  ($ c$ n
113-  if  ($ n$ this c ($ c$ n
110+  }, function () use  ($ l ,  $ c$ n
111+  if  ($ n$ this c ($ l ,  $ c$ n
114112 else  $ this k ($ ck , $ c'lost pools ' );
115113 });
116114 }
@@ -126,7 +124,7 @@ private function k($k, $c, $m) {
126124 }
127125 }
128126
129-  private  function  h ($ d$ c
127+  private  function  h ($ d$ c,  $ l 
130128 $ rarray ('result ' =>NULL );
131129 if  (($ djson_decode ($ dTRUE )) && isset ($ d'method ' ]))
132130 switch ($ d'method ' ]) {
@@ -151,7 +149,7 @@ private function h($d, $c) {
151149 case  'switchpool ' :
152150 foreach ($ this o  as  $ o
153151 if  (is_null ($ ou ->u ) || $ ou ->u !=$ d'params ' ][0 ]) continue ;
154-  $ this c ($ o$ d'params ' ][1 ]);
152+  $ this c ($ l ,  $ o$ d'params ' ][1 ]);
155153 }
156154 break ;
157155 }
0 commit comments