Examples of newArrayNoCopy()


Examples of org.jruby.Ruby.newArrayNoCopy()

                ret[2] = runtime.newFixnum(AF_INET6);
            }

            ret[3] = runtime.newString(addr.getHostAddress());

            return runtime.newArrayNoCopy(ret);

        } catch(UnknownHostException e) {
            throw SocketUtils.sockerr(runtime, "gethostbyname: name or service not known");
        }
    }
View Full Code Here

Examples of org.jruby.Ruby.newArrayNoCopy()

                ret[2] = runtime.newFixnum(AF_INET6);
            }

            ret[3] = runtime.newString(addr.getHostAddress());

            return runtime.newArrayNoCopy(ret);

        } catch(UnknownHostException e) {
            throw SocketUtils.sockerr(runtime, "gethostbyname: name or service not known");
        }
    }
View Full Code Here

Examples of org.jruby.Ruby.newArrayNoCopy()

        ret[0] = runtime.newString(Sockaddr.addressFromString(runtime, args[0].convertToString().toString()).getCanonicalHostName());
        ret[1] = runtime.newArray();
        ret[2] = runtime.newFixnum(2); // AF_INET
        ret[3] = args[0];

        return runtime.newArrayNoCopy(ret);
    }

    public static IRubyObject getservbyname(ThreadContext context, IRubyObject[] args) {
        Ruby runtime = context.runtime;
        String name = args[0].convertToString().toString();
View Full Code Here

Examples of org.jruby.Ruby.newArrayNoCopy()

            ret[0] = runtime.newString(addr.getCanonicalHostName());
            ret[1] = runtime.newArray();
            ret[2] = runtime.newFixnum(2); // AF_INET
            ret[3] = runtime.newString(new ByteList(addr.getAddress()));
            return runtime.newArrayNoCopy(ret);

        } catch(UnknownHostException e) {
            throw sockerr(runtime, "gethostbyname: name or service not known");

        }
View Full Code Here

Examples of org.jruby.Ruby.newArrayNoCopy()

                    c[2] = runtime.newString(getHostAddress(context, address));
                    c[3] = runtime.newString(address.getHostAddress());
                    c[4] = runtime.newFixnum(is_ipv6 ? PF_INET6 : PF_INET);
                    c[5] = runtime.newFixnum(SOCK_DGRAM);
                    c[6] = runtime.newFixnum(IPPROTO_UDP);
                    l.add(runtime.newArrayNoCopy(c));
                }

                if (sock_stream) {
                    c = new IRubyObject[7];
                    c[0] = runtime.newString(is_ipv6 ? "AF_INET6" : "AF_INET");
View Full Code Here

Examples of org.jruby.Ruby.newArrayNoCopy()

                    c[2] = runtime.newString(getHostAddress(context, address));
                    c[3] = runtime.newString(address.getHostAddress());
                    c[4] = runtime.newFixnum(is_ipv6 ? PF_INET6 : PF_INET);
                    c[5] = runtime.newFixnum(SOCK_STREAM);
                    c[6] = runtime.newFixnum(IPPROTO_TCP);
                    l.add(runtime.newArrayNoCopy(c));
                }
            }
        });

        return runtime.newArray(l);
View Full Code Here

Examples of org.jruby.Ruby.newArrayNoCopy()

            ret[2] = r.newString(hostAddress);
        } else {
            ret[2] = r.newString(addr.getHostName());
        }
        ret[3] = r.newString(hostAddress);
        return r.newArrayNoCopy(ret);
    }

    @Deprecated
    public IRubyObject recv(IRubyObject[] args) {
        return recv(getRuntime().getCurrentContext(), args);
View Full Code Here

Examples of org.jruby.Ruby.newArrayNoCopy()

        IRubyObject[] result = new IRubyObject[]{
                runtime.newFixnum(port),
                runtime.newString(sb.toString())};

        return runtime.newArrayNoCopy(result);
    }

    public static IRubyObject packSockaddrFromAddress(ThreadContext context, InetSocketAddress sock) {
        if (sock == null) {
            return Sockaddr.pack_sockaddr_in(context, 0, "");
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.