234235236237238239240241242243244
public void setTimeToLive(int ttl) { if (socket instanceof MulticastSocket) { try { ((MulticastSocket) socket).setTimeToLive(ttl); } catch (IOException e) { throw new ChannelException(e); } } else { throw new UnsupportedOperationException(); } }
245246247248249250251252
public int getTrafficClass() { try { return socket.getTrafficClass(); } catch (SocketException e) { throw new ChannelException(e); } }
253254255256257258259260
public void setTrafficClass(int trafficClass) { try { socket.setTrafficClass(trafficClass); } catch (SocketException e) { throw new ChannelException(e); } }
180181182183184185186187188189190
if (!started) { // Open a selector if this worker didn't start yet. try { this.selector = selector = Selector.open(); } catch (Throwable t) { throw new ChannelException( "Failed to create a selector.", t); } // Start the worker thread with the new Selector. boolean success = false;
349350351352353354355356357
public void run() { try { channel.socket.register( boss.selector, SelectionKey.OP_CONNECT, channel); } catch (ClosedChannelException e) { throw new ChannelException( "Failed to register a socket to the selector.", e); } }
626364656667686970
super(null, factory, pipeline, sink); try { socket = new MulticastSocket(null); } catch (IOException e) { throw new ChannelException("Failed to open a datagram socket.", e); } config = new DefaultDatagramChannelConfig(socket); }
110111112113114115116117
public void joinGroup(InetAddress multicastAddress) { try { socket.joinGroup(multicastAddress); } catch (IOException e) { throw new ChannelException(e); } }
119120121122123124125126
public void joinGroup( InetSocketAddress multicastAddress, NetworkInterface networkInterface) { try { socket.joinGroup(multicastAddress, networkInterface); } catch (IOException e) { throw new ChannelException(e); } }
127128129130131132133134
public void leaveGroup(InetAddress multicastAddress) { try { socket.leaveGroup(multicastAddress); } catch (IOException e) { throw new ChannelException(e); } }
136137138139140141142143
public void leaveGroup( InetSocketAddress multicastAddress, NetworkInterface networkInterface) { try { socket.leaveGroup(multicastAddress, networkInterface); } catch (IOException e) { throw new ChannelException(e); } }