@Override public int getSendBufferSize() { try { return javaSocket.getSendBufferSize(); } catch (SocketException e) { throw new ChannelException(e); } }
@Override public int getSendBufferSize() { try { return javaSocket.getSendBufferSize(); } catch (SocketException e) { throw new ChannelException(e); } }
@Override public int getSendBufferSize() { try { return javaSocket.getSendBufferSize(); } catch (SocketException e) { throw new ChannelException(e); } }
public int getSendBufferSize() { try { return socket.getSendBufferSize(); } catch (SocketException e) { throw new ChannelException(e); } }
/** * Initialize AgentMonitoringListener. * * @param port the port of the local agent * @throws SdkClientException */ public AgentMonitoringListener(int port) throws SdkClientException { try { this.dispatcher = AsynchronousAgentDispatcher.getInstance(); this.dispatcher.init(); channel = DatagramChannel.open(); channel.configureBlocking(false); if (channel.socket().getSendBufferSize() < MAX_BUFFER_SIZE) { channel.socket().setSendBufferSize(MAX_BUFFER_SIZE); } //SO_SNDBUF is just a hint and it is implementation specific if the packet is sent or discarded. maxSize = Math.min(MAX_BUFFER_SIZE, channel.socket().getSendBufferSize()); if (maxSize < MAX_BUFFER_SIZE && LOG.isDebugEnabled()) { LOG.debug(String.format("System socket buffer size %d is less than 8K. Any events larger than the buffer size " + "will be dropped", maxSize)); } channel.connect(new InetSocketAddress("localhost", port)); } catch (Exception e) { throw new SdkClientException("Failed to initialize AgentMonitoringListener", e); } }
public <T> T getOption(final Option<T> option) throws UnsupportedOptionException, IOException { final DatagramChannel channel = datagramChannel; final DatagramSocket socket = channel.socket(); if (option == Options.RECEIVE_BUFFER) { return option.cast(Integer.valueOf(socket.getReceiveBufferSize())); } else if (option == Options.SEND_BUFFER) { return option.cast(Integer.valueOf(socket.getSendBufferSize())); } else if (option == Options.BROADCAST) { return option.cast(Boolean.valueOf(socket.getBroadcast())); } else if (option == Options.IP_TRAFFIC_CLASS) { return option.cast(Integer.valueOf(socket.getTrafficClass())); } else if (option == Options.MULTICAST_TTL) { return option.cast(channel.getOption(StandardSocketOptions.IP_MULTICAST_TTL)); } else { return null; } }
old = Integer.valueOf(socket.getSendBufferSize()); int newValue = Options.SEND_BUFFER.cast(value, Integer.valueOf(DEFAULT_BUFFER_SIZE)).intValue(); if (newValue < 1) {
protected void setBufferSize(DatagramSocket sock, int send_buf_size, int recv_buf_size) { try { sock.setSendBufferSize(send_buf_size); int actual_size=sock.getSendBufferSize(); if(actual_size < send_buf_size && log.isWarnEnabled()) { log.warn(Util.getMessage("IncorrectBufferSize"), "send", sock.getClass().getSimpleName(), Util.printBytes(send_buf_size), Util.printBytes(actual_size), "send", "net.core.wmem_max"); } } catch(Throwable ex) { log.warn(Util.getMessage("BufferSizeFailed"), "send", send_buf_size, sock, ex); } try { sock.setReceiveBufferSize(recv_buf_size); int actual_size=sock.getReceiveBufferSize(); if(actual_size < recv_buf_size && log.isWarnEnabled()) { log.warn(Util.getMessage("IncorrectBufferSize"), "receive", sock.getClass().getSimpleName(), Util.printBytes(recv_buf_size), Util.printBytes(actual_size), "receive", "net.core.rmem_max"); } } catch(Throwable ex) { log.warn(Util.getMessage("BufferSizeFailed"), "receive", recv_buf_size, sock, ex); } }
int getSendBufferSize() throws SocketException { return ds.getSendBufferSize(); } }
/** * Initialize AgentMonitoringListener. * * @param port the port of the local agent * @throws SdkClientException */ public AgentMonitoringListener(int port) throws SdkClientException { try { this.dispatcher = AsynchronousAgentDispatcher.getInstance(); this.dispatcher.init(); channel = DatagramChannel.open(); channel.configureBlocking(false); if (channel.socket().getSendBufferSize() < MAX_BUFFER_SIZE) { channel.socket().setSendBufferSize(MAX_BUFFER_SIZE); } //SO_SNDBUF is just a hint and it is implementation specific if the packet is sent or discarded. maxSize = Math.min(MAX_BUFFER_SIZE, channel.socket().getSendBufferSize()); if (maxSize < MAX_BUFFER_SIZE && LOG.isDebugEnabled()) { LOG.debug(String.format("System socket buffer size %d is less than 8K. Any events larger than the buffer size " + "will be dropped", maxSize)); } channel.connect(new InetSocketAddress("localhost", port)); } catch (Exception e) { throw new SdkClientException("Failed to initialize AgentMonitoringListener", e); } }
@Override public int getSendBufferSize() { try { return javaSocket.getSendBufferSize(); } catch (SocketException e) { throw new ChannelException(e); } }
@Override public int getSendBufferSize() { try { return javaSocket.getSendBufferSize(); } catch (SocketException e) { throw new ChannelException(e); } }
@Override public int getSendBufferSize() { try { return javaSocket.getSendBufferSize(); } catch (SocketException e) { throw new ChannelException(e); } }
@Override public int getSendBufferSize() { try { return javaSocket.getSendBufferSize(); } catch (SocketException e) { throw new ChannelException(e); } }
@Override public int getSendBufferSize() { try { return javaSocket.getSendBufferSize(); } catch (SocketException e) { throw new ChannelException(e); } }
@Override public int getSendBufferSize() { try { return javaSocket.getSendBufferSize(); } catch (SocketException e) { throw new ChannelException(e); } }
public void checkDatagramSocket(DatagramSocket socket) throws SocketException { final long sizeTotal = count * size; if (sizeTotal < socket.getReceiveBufferSize()) { LOGGER.warn("Total buffer size {} is less than UDP socket SO_RCVBUF buffer size {}. Increase buffer size", sizeTotal, socket.getReceiveBufferSize()); } if (sizeTotal < socket.getSendBufferSize()) { LOGGER.warn("Total buffer size {} is less than UDP socket SO_SNDBUF buffer size {}. Increase buffer size", sizeTotal, socket.getSendBufferSize()); } }
@Override public int getSendBufferSize() { try { return javaSocket.getSendBufferSize(); } catch (SocketException e) { throw new ChannelException(e); } }
/** * * @throws RuntimeIoException If the socket is closed or if we get an * {@link SocketException} */ @Override public int getSendBufferSize() { try { return channel.socket().getSendBufferSize(); } catch (SocketException e) { throw new RuntimeIoException(e); } }
int sndBufferSize; try { sndBufferSize = ch.socket().getSendBufferSize(); session.getConfig().setSendBufferSize(sndBufferSize); } catch (SocketException e) {