public int getSocketOption(byte option) throws IllegalArgumentException, IOException {
        switch(option){
        case SocketConnection.DELAY:
            return socket.getTcpNoDelay() ? 0 : 1;
        case SocketConnection.KEEPALIVE:
            return socket.getKeepAlive() ? 1 : 0;  
        case SocketConnection.LINGER:
            return socket.getSoLinger();
        case SocketConnection.RCVBUF:
            return socket.getReceiveBufferSize();
        case SocketConnection.SNDBUF:
            return socket.getSendBufferSize();
        default:
            throw new IllegalArgumentException();
        }
    }