@@ -132,8 +132,8 @@ public synchronized void close() {
132132 Utilities .close (socket );
133133 }
134134
135- private void monitorSocket (final Socket socket ) {
136- logger .debug ("Launching Monitoring Thread for socket {}" , socket );
135+ private void monitorSocket (final Socket socketToMonitor ) {
136+ logger .debug ("Launching Monitoring Thread for socket {}" , socketToMonitor );
137137
138138 Thread t = threadFactory .newThread (new Runnable () {
139139 final static int EXPECTED_SIZE = 6 ;
@@ -145,7 +145,7 @@ public void run() {
145145 try {
146146 InputStream in ;
147147 try {
148- in = socket .getInputStream ();
148+ in = socketToMonitor .getInputStream ();
149149 } catch (IOException ioe ) {
150150 logger .warn ("The value of socket is null" , ioe );
151151 in = null ;
@@ -156,7 +156,7 @@ public void run() {
156156 logger .debug ("Error-response packet {}" , Utilities .encodeHex (bytes ));
157157 // Quickly close socket, so we won't ever try to send push notifications
158158 // using the defective socket.
159- Utilities .close (socket );
159+ Utilities .close (socketToMonitor );
160160
161161 int command = bytes [0 ] & 0xFF ;
162162 if (command != 8 ) {
@@ -222,7 +222,7 @@ public void run() {
222222 logger .info ("Exception while waiting for error code" , e );
223223 delegate .connectionClosed (DeliveryError .UNKNOWN , -1 );
224224 } finally {
225- close ();
225+ Utilities . close (socketToMonitor );
226226 drainBuffer ();
227227 }
228228 }
0 commit comments