@Test public void testGetChannel() throws Exception { System.out.println("getChannel"); DatagramChannel result = (DatagramChannel) instance.getChannel(); assertNotNull(result); }
@Override protected AbstractSelectableChannel getChannel() throws IOException { DatagramChannel c; if (isWaitResponse()) { c = DatagramChannelWithTimeouts.open(); ((DatagramChannelWithTimeouts) c).setReadTimeout(getTimeoutAsInt()); } else { c = DatagramChannel.open(); } String bindAddress = getBindAddress(); if (bindAddress.isEmpty()) { bindAddress = "0.0.0.0"; } int adr = getBindPortAsInt(); c.bind(new InetSocketAddress(bindAddress, adr)); int port = Integer.parseInt(getPort()); c.connect(new InetSocketAddress(getHostName(), port)); return c; }
UDPSampler extends AbstractIPSampler implements UDPTrafficDecoder, ThreadListener { @Override protected AbstractSelectableChannel getChannel() throws IOException { DatagramChannel c; if (isWaitResponse()) { c = DatagramChannelWithTimeouts.open(); ((DatagramChannelWithTimeouts) c).setReadTimeout(getTimeoutAsInt()); } else { c = DatagramChannel.open(); } String bindAddress = getBindAddress(); if (bindAddress.isEmpty()) { bindAddress = "0.0.0.0"; } int adr = getBindPortAsInt(); c.bind(new InetSocketAddress(bindAddress, adr)); int port = Integer.parseInt(getPort()); c.connect(new InetSocketAddress(getHostName(), port)); return c; } }
UDPSampler extends AbstractIPSampler implements UDPTrafficDecoder, ThreadListener { @Override protected AbstractSelectableChannel getChannel() throws IOException { DatagramChannel c; if (isWaitResponse()) { c = DatagramChannelWithTimeouts.open(); ((DatagramChannelWithTimeouts) c).setReadTimeout(getTimeoutAsInt()); } else { c = DatagramChannel.open(); } String bindAddress = getBindAddress(); if (bindAddress.isEmpty()) { bindAddress = "0.0.0.0"; } int adr = getBindPortAsInt(); c.bind(new InetSocketAddress(bindAddress, adr)); int port = Integer.parseInt(getPort()); c.connect(new InetSocketAddress(getHostName(), port)); return c; }  }
UDPSampler extends AbstractIPSampler implements UDPTrafficDecoder, ThreadListener { @Override protected AbstractSelectableChannel getChannel() throws IOException { DatagramChannel c; if (isWaitResponse()) { c = DatagramChannelWithTimeouts.open(); ((DatagramChannelWithTimeouts) c).setReadTimeout(getTimeoutAsInt()); } else { c = DatagramChannel.open(); } String bindAddress = getBindAddress(); if (bindAddress.isEmpty()) { bindAddress = "0.0.0.0"; } int adr = getBindPortAsInt(); c.bind(new InetSocketAddress(bindAddress, adr)); int port = Integer.parseInt(getPort()); c.connect(new InetSocketAddress(getHostName(), port)); return c; }  boolean isWaitResponse(); boolean isCloseChannel(); String getEncoderClass(); void setWaitResponse(boolean selected); void setCloseChannel(boolean selected); void setEncoderClass(String text); String getBindAddress(); void setBindAddress(String text); String getBindPort(); int getBindPortAsInt(); void setBindPort(String text); @Override ByteBuffer encode(String data); @Override byte[] decode(byte[] buf); @Override void threadStarted(); @Override void threadFinished(); @Override boolean interrupt(); }
UDPSampler extends AbstractIPSampler implements UDPTrafficDecoder, ThreadListener { @Override protected AbstractSelectableChannel getChannel() throws IOException { DatagramChannel c; if (isWaitResponse()) { c = DatagramChannelWithTimeouts.open(); ((DatagramChannelWithTimeouts) c).setReadTimeout(getTimeoutAsInt()); } else { c = DatagramChannel.open(); } String bindAddress = getBindAddress(); if (bindAddress.isEmpty()) { bindAddress = "0.0.0.0"; } int adr = getBindPortAsInt(); c.bind(new InetSocketAddress(bindAddress, adr)); int port = Integer.parseInt(getPort()); c.connect(new InetSocketAddress(getHostName(), port)); return c; }  boolean isWaitResponse(); boolean isCloseChannel(); String getEncoderClass(); void setWaitResponse(boolean selected); void setCloseChannel(boolean selected); void setEncoderClass(String text); String getBindAddress(); void setBindAddress(String text); String getBindPort(); int getBindPortAsInt(); void setBindPort(String text); @Override ByteBuffer encode(String data); @Override byte[] decode(byte[] buf); @Override void threadStarted(); @Override void threadFinished(); @Override boolean interrupt(); static final String ENCODECLASS; static final String WAITRESPONSE; static final String CLOSECHANNEL; static final String BIND_ADDRESS; static final String BIND_PORT; }