@@ -132,8 +132,8 @@ public synchronized void close() {
132
132
Utilities .close (socket );
133
133
}
134
134
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 );
137
137
138
138
Thread t = threadFactory .newThread (new Runnable () {
139
139
final static int EXPECTED_SIZE = 6 ;
@@ -145,7 +145,7 @@ public void run() {
145
145
try {
146
146
InputStream in ;
147
147
try {
148
- in = socket .getInputStream ();
148
+ in = socketToMonitor .getInputStream ();
149
149
} catch (IOException ioe ) {
150
150
logger .warn ("The value of socket is null" , ioe );
151
151
in = null ;
@@ -156,7 +156,7 @@ public void run() {
156
156
logger .debug ("Error-response packet {}" , Utilities .encodeHex (bytes ));
157
157
// Quickly close socket, so we won't ever try to send push notifications
158
158
// using the defective socket.
159
- Utilities .close (socket );
159
+ Utilities .close (socketToMonitor );
160
160
161
161
int command = bytes [0 ] & 0xFF ;
162
162
if (command != 8 ) {
@@ -222,7 +222,7 @@ public void run() {
222
222
logger .info ("Exception while waiting for error code" , e );
223
223
delegate .connectionClosed (DeliveryError .UNKNOWN , -1 );
224
224
} finally {
225
- close ();
225
+ Utilities . close (socketToMonitor );
226
226
drainBuffer ();
227
227
}
228
228
}
0 commit comments