HP3000-L Archives

July 1998, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Dirickson Steve <[log in to unmask]>
Reply To:
Dirickson Steve <[log in to unmask]>
Date:
Sat, 18 Jul 1998 17:17:20 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (64 lines)
        <<I am trying to implement NOWAITed I/O using NetIPC.  I seem to have
the choice of an immediate timeout and infinite time out.  Anyone ever do
this?? An example is worth a thousand words.  Oh and I have to do this in
COBOL as it is a COBOL shop.>>


"Timeout" is N/A for NOWAIT I/O; the operation always returns immediately,
and you use IODONTWAIT to see if the physical I/O has completed.

I don't do COBOL, but translating the following should provide what you need.

        int RecvBlockNoWait(SOCKET Sock, char *buf, int maxlen, int
recvflags)
                {
                int dlen = maxlen;
                short rlen = 0;
                int flags = recvflags;
                int res32 = 0;

                IPCCONTROL(Sock, 1,,,,,, &res32);       /* enable NOWAIT */
                if (res32)
                        {
                        printf("IPCCONTROL(1) error: %d\n", res32);
                        fflush(stdout);
                        errno_IPC = res32;
                        return SOCKET_ERROR;
                        }
                IPCRECV(Sock, buf, &dlen, &flags,, &res32);
                if (res32)
                        {
                        printf("Waited IPCRECV error: %d\n", res32);
                        fflush(stdout);
                        errno_IPC = res32;
                        return SOCKET_ERROR;
                        }
                dlen = 0;
                if (IODONTWAIT(Sock, buf, &rlen))       /* try to complete
the receive */
                        {
                        dlen = rlen;
                        }
                IPCCONTROL(Sock, 258,,,,,, &res32);
                if (res32)
                        {
                        printf("IPCCONTROL(258) error: %d\n", res32);
                        fflush(stdout);
                        }

                IPCCONTROL(Sock, 2,,,,,, &res32);       /* disable NOWAIT */
                if (res32)
                        {
                        printf("IPCCONTROL(2) error: %d\n", res32);
                        fflush(stdout);
                        }
                return dlen;
                }


Steve


Steve Dirickson    WestWin Consulting
(360) 598-6111   [log in to unmask]

ATOM RSS1 RSS2