Examples of allocateControl()


Examples of jnr.posix.MsgHdr.allocateControl()

        //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) {
View Full Code Here

Examples of jnr.posix.MsgHdr.allocateControl()

        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.