@Override public int getReceiveBufferSize() { try { return javaSocket.getReceiveBufferSize(); } catch (SocketException e) { throw new ChannelException(e); } }
@Override public int getReceiveBufferSize() { try { return javaSocket.getReceiveBufferSize(); } catch (SocketException e) { throw new ChannelException(e); } }
@Override public int getReceiveBufferSize() { try { return javaSocket.getReceiveBufferSize(); } catch (SocketException e) { throw new ChannelException(e); } }
public int getReceiveBufferSize() { try { return socket.getReceiveBufferSize(); } catch (SocketException e) { throw new ChannelException(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; } }
final Object old; if (option == Options.RECEIVE_BUFFER) { old = Integer.valueOf(socket.getReceiveBufferSize()); int newValue = Options.RECEIVE_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); } }
public void setReceiveBufferSize(DatagramSocket ds) throws SocketException { int size = ds.getReceiveBufferSize(); if (receiveBufferSize == 0) { receiveBufferSize = size; } else if (receiveBufferSize != size) { ds.setReceiveBufferSize(receiveBufferSize); receiveBufferSize = ds.getReceiveBufferSize(); } }
@Override public int getReceiveBufferSize() { try { return javaSocket.getReceiveBufferSize(); } catch (SocketException e) { throw new ChannelException(e); } }
@Override public int getReceiveBufferSize() { try { return javaSocket.getReceiveBufferSize(); } 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 getReceiveBufferSize() { try { return javaSocket.getReceiveBufferSize(); } catch (SocketException e) { throw new ChannelException(e); } }
@Override public int getReceiveBufferSize() { try { return javaSocket.getReceiveBufferSize(); } catch (SocketException e) { throw new ChannelException(e); } }
/** * @see org.epics.pvaccess.impl.remote.Transport#getSocketReceiveBufferSize() */ public int getSocketReceiveBufferSize() { try { return channel.socket().getReceiveBufferSize(); } catch (SocketException e) { // error return -1; } }
public int getReceiveBufferSize() { try { return socket.getReceiveBufferSize(); } catch (SocketException e) { throw new ChannelException(e); } }
protected DatagramConnectionImpl(PrimitiveURI uri, boolean serverMode) throws IOException { if(serverMode) { socket= new DatagramSocket(uri.port); _defaultAddress= null; } else { socket= new DatagramSocket(); _defaultAddress= uri; } int sendBuf= socket.getSendBufferSize(); int recvBuf= socket.getReceiveBufferSize(); _maximumSize= sendBuf > recvBuf ? recvBuf : sendBuf; }
public DatagramInputStream(int port) throws SocketException { this.port = port; resettableByteArrayInputStream = new ResettableByteArrayInputStream(); datagramSocketToListenOn = new DatagramSocket(port); datagramSocketToListenOn.setReceiveBufferSize(BUFFER_SIZE); int actualBufferSize = datagramSocketToListenOn.getReceiveBufferSize(); if (VERBOSE) System.out.println("DatagramInputStream actualBufferSize = " + actualBufferSize); }
@Override public int getReceiveBufferSize() { try { return ch.socket().getReceiveBufferSize(); } catch (SocketException e) { throw new RuntimeIOException(e); } }
int rcvBufferSize; try { rcvBufferSize = ch.socket().getReceiveBufferSize(); session.getConfig().setReadBufferSize(rcvBufferSize);
protected NetServerIn(String name, Logger logmon) throws IOException { super(name + ".NetServerIn", logmon); socket = new DatagramSocket(port); socket.setReceiveBufferSize(AgentServer.getInteger("UDPReceiveBufferSize", 1048576).intValue()); socket.setSendBufferSize(AgentServer.getInteger("UDPSendBufferSize", 8192).intValue()); if (logmon.isLoggable(BasicLevel.DEBUG)) { logmon.log(BasicLevel.DEBUG, this.getName() + ", socket buffer sizes: Receive:" + socket.getReceiveBufferSize() + " Send:" + socket.getSendBufferSize()); } socketReceiveBufferSize = socket.getReceiveBufferSize(); socketSendBufferSize = socket.getSendBufferSize(); }