Check whether the socket has been set to null due to a failed

re-binding.
This commit is contained in:
akwizgran
2011-10-06 19:32:55 +01:00
parent c08f6c4d1e
commit 6d68fa5c4a

View File

@@ -88,6 +88,7 @@ implements StreamTransportPlugin {
Socket s;
synchronized(this) {
if(!started) return;
if(socket == null) return;
ss = socket;
}
try {
@@ -114,7 +115,10 @@ implements StreamTransportPlugin {
public synchronized void stop() throws IOException {
super.stop();
if(socket != null) socket.close();
if(socket != null) {
socket.close();
socket = null;
}
}
public synchronized void setLocalProperties(Map<String, String> properties)
@@ -129,6 +133,7 @@ implements StreamTransportPlugin {
} catch(IOException e) {
// FIXME: Logging
}
socket = null;
executor.execute(createBinder());
}
}