@Test public void testGetSocketChannel() throws Exception { System.out.println("getSocketChannel"); SocketChannel result = instance.getSocketChannel(); assertNotNull(result); }
protected SocketChannel getSocketChannel() throws IOException { if (isUseKeepAlive() && savedSock != null) { return savedSock; } int port; try { port = Integer.parseInt(getPort()); } catch (NumberFormatException ex) { log.warn("Wrong port number: " + getPort() + ", defaulting to 80", ex); port = 80; } InetSocketAddress address = new InetSocketAddress(getHostName(), port); savedSock = (SocketChannel) getChannel(); savedSock.connect(address); return savedSock; }
HTTPRawSampler extends AbstractIPSampler { protected SocketChannel getSocketChannel() throws IOException { if (isUseKeepAlive() && savedSock != null) { return savedSock; } int port; try { port = Integer.parseInt(getPort()); } catch (NumberFormatException ex) { log.warn("Wrong port number: " + getPort() + ", defaulting to 80", ex); port = 80; } InetSocketAddress address = new InetSocketAddress(getHostName(), port); savedSock = (SocketChannel) getChannel(); savedSock.connect(address); return savedSock; } }
HTTPRawSampler extends AbstractIPSampler { protected SocketChannel getSocketChannel() throws IOException { if (isUseKeepAlive() && savedSock != null) { return savedSock; } int port; try { port = Integer.parseInt(getPort()); } catch (NumberFormatException ex) { log.warn("Wrong port number: " + getPort() + ", defaulting to 80", ex); port = 80; } InetSocketAddress address = new InetSocketAddress(getHostName(), port); savedSock = (SocketChannel) getChannel(); savedSock.connect(address); return savedSock; } HTTPRawSampler(); }
HTTPRawSampler extends AbstractIPSampler { protected SocketChannel getSocketChannel() throws IOException { if (isUseKeepAlive() && savedSock != null) { return savedSock; } int port; try { port = Integer.parseInt(getPort()); } catch (NumberFormatException ex) { log.warn("Wrong port number: " + getPort() + ", defaulting to 80", ex); port = 80; } InetSocketAddress address = new InetSocketAddress(getHostName(), port); savedSock = (SocketChannel) getChannel(); savedSock.connect(address); return savedSock; } HTTPRawSampler(); @Override SampleResult sample(Entry entry); boolean isUseKeepAlive(); void setUseKeepAlive(boolean selected); boolean isParseResult(); void setParseResult(boolean selected); String getFileToSend(); void setFileToSend(String text); @Override boolean interrupt(); }
HTTPRawSampler extends AbstractIPSampler { protected SocketChannel getSocketChannel() throws IOException { if (isUseKeepAlive() && savedSock != null) { return savedSock; } int port; try { port = Integer.parseInt(getPort()); } catch (NumberFormatException ex) { log.warn("Wrong port number: " + getPort() + ", defaulting to 80", ex); port = 80; } InetSocketAddress address = new InetSocketAddress(getHostName(), port); savedSock = (SocketChannel) getChannel(); savedSock.connect(address); return savedSock; } HTTPRawSampler(); @Override SampleResult sample(Entry entry); boolean isUseKeepAlive(); void setUseKeepAlive(boolean selected); boolean isParseResult(); void setParseResult(boolean selected); String getFileToSend(); void setFileToSend(String text); @Override boolean interrupt();  }