@Override public ChannelFuture leaveGroup(InetAddress multicastAddress, ChannelPromise promise) { try { socket.leaveGroup(multicastAddress); promise.setSuccess(); } catch (IOException e) { promise.setFailure(e); } return promise; }
@Override public ChannelFuture leaveGroup( InetSocketAddress multicastAddress, NetworkInterface networkInterface, ChannelPromise promise) { try { socket.leaveGroup(multicastAddress, networkInterface); promise.setSuccess(); } catch (IOException e) { promise.setFailure(e); } return promise; }
@Override public void close() { uri = null; if (multicastSocket != null) { try { multicastSocket.leaveGroup(address); } catch (IOException e) { // Do nothing. } multicastSocket = null; } if (socket != null) { socket.close(); socket = null; } address = null; socketAddress = null; packetRemaining = 0; if (opened) { opened = false; transferEnded(); } }
@Override public ChannelFuture leaveGroup( InetSocketAddress multicastAddress, NetworkInterface networkInterface, ChannelPromise promise) { try { socket.leaveGroup(multicastAddress, networkInterface); promise.setSuccess(); } catch (IOException e) { promise.setFailure(e); } return promise; }
@Override public ChannelFuture leaveGroup(InetAddress multicastAddress, ChannelPromise promise) { try { socket.leaveGroup(multicastAddress); promise.setSuccess(); } catch (IOException e) { promise.setFailure(e); } return promise; }
public static void closeQuietly(final MulticastSocket socket, final InetAddress groupAddress) { if (socket == null) { return; } try { socket.leaveGroup(groupAddress); } catch (final Exception ex) { logger.debug("Failed to leave multicast group due to: " + ex, ex); } try { socket.close(); } catch (final Exception ex) { logger.debug("Failed to close multicast socket due to: " + ex, ex); } } }
synchronized public void stop() { if (socket != null && !socket.isClosed()) { try { log.fine("Leaving multicast group"); socket.leaveGroup(multicastAddress, multicastInterface); // Well this doesn't work and I have no idea why I get "java.net.SocketException: Can't assign requested address" } catch (Exception ex) { log.fine("Could not leave multicast group: " + ex); } // So... just close it and ignore the log messages socket.close(); } }
@Override public ChannelFuture leaveGroup(InetAddress multicastAddress, ChannelPromise promise) { try { socket.leaveGroup(multicastAddress); promise.setSuccess(); } catch (IOException e) { promise.setFailure(e); } return promise; }
@Override public ChannelFuture leaveGroup( InetSocketAddress multicastAddress, NetworkInterface networkInterface, ChannelPromise promise) { try { socket.leaveGroup(multicastAddress, networkInterface); promise.setSuccess(); } catch (IOException e) { promise.setFailure(e); } return promise; }
public ChannelFuture leaveGroup(InetAddress multicastAddress) { try { socket.leaveGroup(multicastAddress); return succeededFuture(this); } catch (IOException e) { return failedFuture(this, e); } }
public ChannelFuture leaveGroup( InetSocketAddress multicastAddress, NetworkInterface networkInterface) { try { socket.leaveGroup(multicastAddress, networkInterface); return succeededFuture(this); } catch (IOException e) { return failedFuture(this, e); } }
/** * Remove the expired providers(if clean is true), leave the multicast group and close the multicast socket. */ @Override public void destroy() { super.destroy(); try { ExecutorUtil.cancelScheduledFuture(cleanFuture); } catch (Throwable t) { logger.warn(t.getMessage(), t); } try { multicastSocket.leaveGroup(multicastAddress); multicastSocket.close(); } catch (Throwable t) { logger.warn(t.getMessage(), t); } ExecutorUtil.gracefulShutdown(cleanExecutor, cleanPeriod); }
/** * Remove the expired providers(if clean is true), leave the multicast group and close the multicast socket. */ @Override public void destroy() { super.destroy(); try { ExecutorUtil.cancelScheduledFuture(cleanFuture); } catch (Throwable t) { logger.warn(t.getMessage(), t); } try { multicastSocket.leaveGroup(multicastAddress); multicastSocket.close(); } catch (Throwable t) { logger.warn(t.getMessage(), t); } ExecutorUtil.gracefulShutdown(cleanExecutor, cleanPeriod); }
public void stop() throws IOException { if (isRunning() == false) { return; } // shutdown executor service try { if (getShutdownListenerSeconds() <= 0) { executorService.shutdownNow(); } else { executorService.shutdown(); } executorService.awaitTermination(getShutdownListenerSeconds(), TimeUnit.SECONDS); } catch (final InterruptedException ex) { Thread.currentThread().interrupt(); } finally { if (executorService.isTerminated()) { logger.info("Multicast Listener has been terminated successfully."); } else { logger.warn("Multicast Listener has not terminated properly. There exists an uninterruptable thread that will take an indeterminate amount of time to stop."); } } // shutdown server socket if (multicastSocket.isClosed() == false) { multicastSocket.leaveGroup(multicastAddress.getAddress()); multicastSocket.close(); } }
protected void doStop(ServiceStopper stopper) throws Exception { super.doStop(stopper); if (socket != null) { try { socket.leaveGroup(getMulticastAddress()); } catch (IOException e) { stopper.onException(this, e); } socket.close(); } }
errsock.leaveGroup(tmp); // Could throw, but errgroup cleared for next pass
void closeMulticastSocket() { if(mcast_sock != null) { try { if(mcast_addr != null) { mcast_sock.leaveGroup(mcast_addr.getIpAddress()); } getSocketFactory().close(mcast_sock); // this will cause the mcast receiver thread to break out of its loop mcast_sock=null; if(log.isDebugEnabled()) log.debug("multicast socket closed"); } catch(IOException ex) { } mcast_addr=null; } }
/** * {@inheritDoc} */ @Override public final void interrupt() { try { socket.leaveGroup(groupMulticastAddress); } catch (IOException e) { LOG.error("Error leaving group"); } socket.close(); super.interrupt(); } }
public boolean close() { if (ssdpMultiSock == null) return true; try { ssdpMultiSock.leaveGroup(ssdpMultiGroup, ssdpMultiIf); ssdpMultiSock.close(); ssdpMultiSock = null; } catch (Exception e) { //Debug.warning(e); return false; } return true; }
synchronized public void stop() { if (socket != null && !socket.isClosed()) { try { log.fine("Leaving multicast group"); socket.leaveGroup(multicastAddress, multicastInterface); // Well this doesn't work and I have no idea why I get "java.net.SocketException: Can't assign requested address" } catch (Exception ex) { log.fine("Could not leave multicast group: " + ex); } // So... just close it and ignore the log messages socket.close(); } }