mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 03:09:04 +01:00
Close and reopen the socket if necessary when the properties change.
This commit is contained in:
@@ -130,6 +130,18 @@ abstract class SocketPlugin implements StreamTransportPlugin {
|
||||
throws InvalidPropertiesException {
|
||||
if(!started) throw new IllegalStateException();
|
||||
localProperties = properties;
|
||||
// Close and reopen the socket if its address has changed
|
||||
if(socket != null) {
|
||||
SocketAddress addr = socket.getLocalSocketAddress();
|
||||
if(!getLocalSocketAddress().equals(addr)) {
|
||||
try {
|
||||
socket.close();
|
||||
} catch(IOException e) {
|
||||
// FIXME: Logging
|
||||
}
|
||||
executor.execute(createBinder());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized void setRemoteProperties(ContactId c,
|
||||
|
||||
Reference in New Issue
Block a user