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