Examples of newErrnoEAGAINReadableError()


Examples of org.jruby.Ruby.newErrnoEAGAINReadableError()

        ByteList bytes = doReceiveNonblock(context, RubyNumeric.fix2int(_length));

        if (bytes == null) {
            if (runtime.is1_9()) {
                throw runtime.newErrnoEAGAINReadableError("recvfrom(2)");
            } else {
                throw runtime.newErrnoEAGAINError("recvfrom(2)");
            }
        }
View Full Code Here

Examples of org.jruby.Ruby.newErrnoEAGAINReadableError()

        Ruby runtime = context.runtime;
        Channel channel = getChannel();

        if (!(channel instanceof SelectableChannel)) {
            if (runtime.is1_9()) {
                throw runtime.newErrnoEAGAINReadableError(channel.getClass().getName() + " does not support nonblocking");
            } else {
                throw runtime.newErrnoEAGAINError(channel.getClass().getName() + " does not support nonblocking");
            }
        }
View Full Code Here

Examples of org.jruby.Ruby.newErrnoEAGAINReadableError()

                }

            } catch (IOException ioe) {
                if (ioe.getMessage().equals("accept failed: Resource temporarily unavailable")) {
                    if (runtime.is1_9()) {
                        throw runtime.newErrnoEAGAINReadableError("accept");
                    } else {
                        throw runtime.newErrnoEAGAINError("accept");
                    }
                }
View Full Code Here

Examples of org.jruby.Ruby.newErrnoEAGAINReadableError()

                if (socket == null) {
                    // This appears to be undocumented in JDK; null as a sentinel value
                    // for a nonblocking accept with nothing available. We raise for Ruby.
                    // indicates that no connection is available in non-blocking mode
                    throw runtime.newErrnoEAGAINReadableError("accept(2) would block");
                }

                RubySocket rubySocket = new RubySocket(runtime, runtime.getClass("Socket"));
                rubySocket.initFromServer(runtime, this, socket);
View Full Code Here

Examples of org.jruby.Ruby.newErrnoEAGAINReadableError()

                throw runtime.newErrnoENOPROTOOPTError();
            }

        } catch (IllegalBlockingModeException ibme) {
            // indicates that no connection is available in non-blocking mode
            throw runtime.newErrnoEAGAINReadableError("accept(2) would block");

        } catch(IOException e) {
            throw SocketUtils.sockerr(runtime, e.getLocalizedMessage());

        }
View Full Code Here

Examples of org.jruby.Ruby.newErrnoEAGAINReadableError()

                if (socket == null) {
                    // This appears to be undocumented in JDK; null as a sentinel value
                    // for a nonblocking accept with nothing available. We raise for Ruby.
                    // indicates that no connection is available in non-blocking mode
                    throw runtime.newErrnoEAGAINReadableError("accept(2) would block");
                }

                RubySocket rubySocket = new RubySocket(runtime, runtime.getClass("Socket"));
                rubySocket.initFromServer(runtime, this, socket);
View Full Code Here

Examples of org.jruby.Ruby.newErrnoEAGAINReadableError()

                throw runtime.newErrnoENOPROTOOPTError();
            }

        } catch (IllegalBlockingModeException ibme) {
            // indicates that no connection is available in non-blocking mode
            throw runtime.newErrnoEAGAINReadableError("accept(2) would block");

        } catch (IOException e) {
            throw SocketUtils.sockerr(runtime, e.getLocalizedMessage());

        }
View Full Code Here

Examples of org.jruby.Ruby.newErrnoEAGAINReadableError()

                    selectable.configureBlocking(oldBlocking);
                }

            } catch (IOException ioe) {
                if (ioe.getMessage().equals("accept failed: Resource temporarily unavailable")) {
                    throw runtime.newErrnoEAGAINReadableError("accept");
                }

                throw context.runtime.newIOErrorFromException(ioe);
            }
        }
View Full Code Here

Examples of org.jruby.Ruby.newErrnoEAGAINReadableError()

        Ruby runtime = context.runtime;

        ByteList bytes = doReceiveNonblock(context, RubyNumeric.fix2int(_length));

        if (bytes == null) {
            throw runtime.newErrnoEAGAINReadableError("recvfrom(2)");
        }

        return RubyString.newString(runtime, bytes);
    }
View Full Code Here

Examples of org.jruby.Ruby.newErrnoEAGAINReadableError()

    public ByteList doReceiveNonblock(ThreadContext context, int length) {
        Ruby runtime = context.runtime;
        Channel channel = getChannel();

        if (!(channel instanceof SelectableChannel)) {
            throw runtime.newErrnoEAGAINReadableError(channel.getClass().getName() + " does not support nonblocking");
        }

        SelectableChannel selectable = (SelectableChannel)channel;

        synchronized (selectable.blockingLock()) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.