Examples of MsgHdr


Examples of jnr.posix.MsgHdr

        this.outPump.start();
    }

    @Override
    public ChannelFuture close() {
        MsgHdr message = posix.allocateMsgHdr();
        ByteBuffer nioBuf = ByteBuffer.allocateDirect(1);
        nioBuf.put( (byte) 0 );
        nioBuf.flip();
        message.setIov(new ByteBuffer[]{ nioBuf });
        int result = posix.sendmsg( this.fd, message, 0 );
        result = posix.fsync(this.fd);


        this.closed = true;
View Full Code Here

Examples of jnr.posix.MsgHdr

        //while ((numRead = posix.recvmsg(this.fd, message, 0)) >= 0) {
        while (true) {
            ByteBuffer buffer = ByteBuffer.allocateDirect(1024);

            MsgHdr message = posix.allocateMsgHdr();
            message.allocateControl(4);
            message.setIov(new ByteBuffer[]{buffer});
            CmsgHdr control = message.getControls()[0];

            int numRead = posix.recvmsg(this.fd, message, 0);
            if (numRead < 0) {
                if (!this.closed) {
                    writeInbound(new IPCRecord(null, -1));
View Full Code Here

Examples of jnr.posix.MsgHdr

        ByteBuffer nioBuf = ByteBuffer.allocateDirect(buf.readableBytes());
        buf.readBytes(nioBuf);
        nioBuf.flip();

        MsgHdr message = posix.allocateMsgHdr();
        message.setIov(new ByteBuffer[]{nioBuf});

        if (fd >= 0) {
            CmsgHdr control = message.allocateControl(4);
            ByteBuffer fdBuf = ByteBuffer.allocateDirect(4);
            fdBuf.order(ByteOrder.nativeOrder());
            fdBuf.putInt(fd);
            fdBuf.flip();
            control.setData(fdBuf);
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.