mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
HCOLL-128 cleanup Replicators closeables handling, fixed small defect -- AbstractConnector.connectLater didn't remove channel from closeables
This commit is contained in:
@@ -169,23 +169,20 @@ class UdpReplicator extends AbstractChannelReplicator implements Replica.Modific
|
||||
|
||||
final InetSocketAddress hostAddress = new InetSocketAddress(port);
|
||||
client.configureBlocking(false);
|
||||
synchronized (closeables) {
|
||||
|
||||
if (address.isMulticastAddress()) {
|
||||
client.setOption(IP_MULTICAST_IF, networkInterface);
|
||||
client.setOption(SO_REUSEADDR, true);
|
||||
client.bind(hostAddress);
|
||||
client.join(address, networkInterface);
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Connecting via multicast, group=" + address);
|
||||
} else {
|
||||
client.bind(hostAddress);
|
||||
}
|
||||
|
||||
if (address.isMulticastAddress()) {
|
||||
client.setOption(IP_MULTICAST_IF, networkInterface);
|
||||
client.setOption(SO_REUSEADDR, true);
|
||||
client.bind(hostAddress);
|
||||
client.join(address, networkInterface);
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Listening on port " + port);
|
||||
closeables.add(client);
|
||||
LOG.debug("Connecting via multicast, group=" + address);
|
||||
} else {
|
||||
client.bind(hostAddress);
|
||||
}
|
||||
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Listening on port " + port);
|
||||
closeables.add(client);
|
||||
return client;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user