@@ -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
in = null ;
151
151
}
@@ -155,7 +155,7 @@ public void run() {
155
155
logger .debug ("Error-response packet {}" , Utilities .encodeHex (bytes ));
156
156
// Quickly close socket, so we won't ever try to send push notifications
157
157
// using the defective socket.
158
- Utilities .close (socket );
158
+ Utilities .close (socketToMonitor );
159
159
160
160
int command = bytes [0 ] & 0xFF ;
161
161
if (command != 8 ) {
@@ -221,7 +221,7 @@ public void run() {
221
221
logger .info ("Exception while waiting for error code" , e );
222
222
delegate .connectionClosed (DeliveryError .UNKNOWN , -1 );
223
223
} finally {
224
- close ();
224
+ Utilities . close (socketToMonitor );
225
225
drainBuffer ();
226
226
}
227
227
}
0 commit comments