Examples of IOHandleInstance


Examples of org.perl6.nqp.sixmodel.reprs.IOHandleInstance

            public void completed(AsynchronousSocketChannel channel, AsyncTaskInstance task) {
                listenChan.accept(task, this);
                ThreadContext curTC = tc.gc.getCurrentThreadContext();

                AsyncSocketHandle handle = new AsyncSocketHandle(curTC, channel);
                IOHandleInstance ioHandle = (IOHandleInstance) IOType.st.REPR.allocate(curTC,
                        IOType.st);
                ioHandle.handle = handle;

                SixModelObject result = Array.st.REPR.allocate(curTC, Array.st);
                result.push_boxed(curTC, task.schedulee);
View Full Code Here

Examples of org.perl6.nqp.sixmodel.reprs.IOHandleInstance

            @Override
            public void completed(Void v, AsyncTaskInstance task) {
                ThreadContext curTC = tc.gc.getCurrentThreadContext();

                IOHandleInstance ioHandle = (IOHandleInstance) IOType.st.REPR.allocate(curTC,
                        IOType.st);
                ioHandle.handle = task.handle;
                callback(curTC, task, ioHandle, Str);
            }
View Full Code Here

Examples of org.perl6.nqp.sixmodel.reprs.IOHandleInstance

        return rval;
    }

    public static SixModelObject open(String path, String mode, ThreadContext tc) {
        SixModelObject IOType = tc.curFrame.codeRef.staticInfo.compUnit.hllConfig.ioType;
        IOHandleInstance h = (IOHandleInstance)IOType.st.REPR.allocate(tc, IOType.st);
        h.handle = new FileHandle(tc, path, mode);
        return h;
    }
View Full Code Here

Examples of org.perl6.nqp.sixmodel.reprs.IOHandleInstance

        return h;
    }

    public static SixModelObject openasync(String path, String mode, ThreadContext tc) {
        SixModelObject IOType = tc.curFrame.codeRef.staticInfo.compUnit.hllConfig.ioType;
        IOHandleInstance h = (IOHandleInstance)IOType.st.REPR.allocate(tc, IOType.st);
        h.handle = new AsyncFileHandle(tc, path, mode);
        return h;
    }
View Full Code Here

Examples of org.perl6.nqp.sixmodel.reprs.IOHandleInstance

        return h;
    }

    public static SixModelObject socket(long listener, ThreadContext tc) {
        SixModelObject IOType = tc.curFrame.codeRef.staticInfo.compUnit.hllConfig.ioType;
        IOHandleInstance h = (IOHandleInstance)IOType.st.REPR.allocate(tc, IOType.st);
        if (listener == 0) {
            h.handle = new SocketHandle(tc);
        } else if (listener > 0) {
            h.handle = new ServerSocketHandle(tc);
        } else {
View Full Code Here

Examples of org.perl6.nqp.sixmodel.reprs.IOHandleInstance

        }
        return h;
    }

    public static SixModelObject connect(SixModelObject obj, String host, long port, ThreadContext tc) {
        IOHandleInstance h = (IOHandleInstance)obj;
        if (h.handle instanceof SocketHandle) {
            ((SocketHandle)h.handle).connect(tc, host, (int) port);
        } else {
            ExceptionHandling.dieInternal(tc,
                "This handle does not support connect");
View Full Code Here

Examples of org.perl6.nqp.sixmodel.reprs.IOHandleInstance

        }
        return obj;
    }

    public static SixModelObject bindsock(SixModelObject obj, String host, long port, ThreadContext tc) {
        IOHandleInstance h = (IOHandleInstance)obj;
        if (h.handle instanceof IIOBindable) {
            ((IIOBindable)h.handle).bind(tc, host, (int) port);
        } else {
            ExceptionHandling.dieInternal(tc,
                "This handle does not support bind");
View Full Code Here

Examples of org.perl6.nqp.sixmodel.reprs.IOHandleInstance

        }
        return obj;
    }

    public static SixModelObject accept(SixModelObject obj, ThreadContext tc) {
        IOHandleInstance listener = (IOHandleInstance)obj;
        if (listener.handle instanceof ServerSocketHandle) {
            SocketHandle handle = ((ServerSocketHandle)listener.handle).accept(tc);
            if (handle != null) {
                SixModelObject IOType = tc.curFrame.codeRef.staticInfo.compUnit.hllConfig.ioType;
                IOHandleInstance h = (IOHandleInstance)IOType.st.REPR.allocate(tc, IOType.st);
                h.handle = handle;
                return h;
            }
        } else {
            ExceptionHandling.dieInternal(tc,
View Full Code Here

Examples of org.perl6.nqp.sixmodel.reprs.IOHandleInstance

        return res;
    }

    public static SixModelObject getstdin(ThreadContext tc) {
        SixModelObject IOType = tc.curFrame.codeRef.staticInfo.compUnit.hllConfig.ioType;
        IOHandleInstance h = (IOHandleInstance)IOType.st.REPR.allocate(tc, IOType.st);
        h.handle = new StandardReadHandle(tc, tc.gc.in);
        return h;
    }
View Full Code Here

Examples of org.perl6.nqp.sixmodel.reprs.IOHandleInstance

        return h;
    }

    public static SixModelObject getstdout(ThreadContext tc) {
        SixModelObject IOType = tc.curFrame.codeRef.staticInfo.compUnit.hllConfig.ioType;
        IOHandleInstance h = (IOHandleInstance)IOType.st.REPR.allocate(tc, IOType.st);
        h.handle = new StandardWriteHandle(tc, tc.gc.out);
        return h;
    }
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.