Example usage for java.net SocketOptions SO_RCVBUF

List of usage examples for java.net SocketOptions SO_RCVBUF

Introduction

In this page you can find the example usage for java.net SocketOptions SO_RCVBUF.

Prototype

int SO_RCVBUF

To view the source code for java.net SocketOptions SO_RCVBUF.

Click Source Link

Document

Set a hint the size of the underlying buffers used by the platform for incoming network I/O.

Usage

From source file:org.jnode.net.ipv4.tcp.TCPSocketImpl.java

/**
 * @see java.net.SocketOptions#getOption(int)
 *//*  w ww  .  j a va 2 s  .c o m*/
public Object getOption(int option_id) throws SocketException {
    switch (option_id) {
    case SocketOptions.SO_BINDADDR:
        return controlBlock.getLocalAddress().toInetAddress();
    case SocketOptions.SO_RCVBUF:
        return controlBlock.getReceiveBufferSize();
    case SocketOptions.SO_SNDBUF:
        return controlBlock.getSendBufferSize();
    case SocketOptions.SO_TIMEOUT:
        // todo implement it, 0 means disabled
        return 0;
    default:
        throw new SocketException("Option " + option_id + " is not recognised or not implemented");
    }
}