Package java.nio.channels

Examples of java.nio.channels.Channel


            asDatagramSocket().setBroadcast(asBoolean(val));
        }
    }

    private void setKeepAlive(IRubyObject val) throws IOException, BadDescriptorException {
        Channel socketChannel = getOpenChannel();
        if(socketChannel instanceof SocketChannel) {
            asSocket().setKeepAlive(asBoolean(val));
        }
    }
View Full Code Here


            asSocket().setKeepAlive(asBoolean(val));
        }
    }

    private void setTcpNoDelay(IRubyObject val) throws IOException, BadDescriptorException {
        Channel socketChannel = getOpenChannel();
        if(socketChannel instanceof SocketChannel) {
            asSocket().setTcpNoDelay(asBoolean(val));
        }
    }
View Full Code Here

            asSocket().setTcpNoDelay(asBoolean(val));
        }
    }

    private void joinMulticastGroup(IRubyObject val) throws IOException, BadDescriptorException {
        Channel socketChannel = getOpenChannel();

        if(socketChannel instanceof DatagramChannel) {
            if (multicastStateManager == null) {
                multicastStateManager = new MulticastStateManager();
            }
View Full Code Here

            }
        }
    }

    private void setReuseAddr(IRubyObject val) throws IOException, BadDescriptorException {
        Channel socketChannel = getOpenChannel();
        if (socketChannel instanceof ServerSocketChannel) {
            asServerSocket().setReuseAddress(asBoolean(val));
        } else if (socketChannel instanceof SocketChannel) {
            asSocket().setReuseAddress(asBoolean(val));
        } else if (socketChannel instanceof DatagramChannel) {
View Full Code Here

            asDatagramSocket().setReuseAddress(asBoolean(val));
        }
    }

    private void setRcvBuf(IRubyObject val) throws IOException, BadDescriptorException {
        Channel socketChannel = getOpenChannel();
        if(socketChannel instanceof SocketChannel) {
            asSocket().setReceiveBufferSize(asNumber(val));
        } else if(socketChannel instanceof ServerSocketChannel) {
            asServerSocket().setReceiveBufferSize(asNumber(val));
        } else if(socketChannel instanceof DatagramChannel) {
View Full Code Here

            asDatagramSocket().setReceiveBufferSize(asNumber(val));
        }
    }

    private void setTimeout(IRubyObject val) throws IOException, BadDescriptorException {
        Channel socketChannel = getOpenChannel();
        if(socketChannel instanceof SocketChannel) {
            asSocket().setSoTimeout(asNumber(val));
        } else if(socketChannel instanceof ServerSocketChannel) {
            asServerSocket().setSoTimeout(asNumber(val));
        } else if(socketChannel instanceof DatagramChannel) {
View Full Code Here

        }
    }

    private void setSndBuf(IRubyObject val) throws IOException, BadDescriptorException {
        try {
            Channel socketChannel = getOpenChannel();
            if(socketChannel instanceof SocketChannel) {
                asSocket().setSendBufferSize(asNumber(val));
            } else if(socketChannel instanceof DatagramChannel) {
                asDatagramSocket().setSendBufferSize(asNumber(val));
            }
View Full Code Here

            throw getRuntime().newErrnoEINVALError(iae.getMessage());
        }
    }

    private void setLinger(IRubyObject val) throws IOException, BadDescriptorException {
        Channel socketChannel = getOpenChannel();
        if(socketChannel instanceof SocketChannel) {
            if(val instanceof RubyBoolean && !val.isTrue()) {
                asSocket().setSoLinger(false, 0);
            } else {
                int num = asNumber(val);
View Full Code Here

            }
        }
    }

    private void setOOBInline(IRubyObject val) throws IOException, BadDescriptorException {
        Channel socketChannel = getOpenChannel();
        if(socketChannel instanceof SocketChannel) {
            asSocket().setOOBInline(asBoolean(val));
        }
    }
View Full Code Here

            return val.isTrue();
        }
    }

    private IRubyObject getKeepAlive(Ruby runtime) throws IOException, BadDescriptorException {
        Channel socketChannel = getOpenChannel();
        return trueFalse(runtime,
                         (socketChannel instanceof SocketChannel) ? asSocket().getKeepAlive() : false
                         );
    }
View Full Code Here

TOP

Related Classes of java.nio.channels.Channel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.