in reply to IPC Message Queues with IPC_NOWAIT

IPC::MSG exposes rcv() which calls msgrcv internally, are you sure you are using IPC::MSG? =)


-Waswas

Replies are listed 'Best First'.
Re: Re: IPC Message Queues with IPC_NOWAIT
by CB900F (Initiate) on Dec 09, 2003 at 19:43 UTC
    Busted, this is my first IPC app. I did some testing and did remove the IPC::MSG and no I am not using that module. It's just the IPC::SysV. But I still cannot pass it the flag of IPC_NOWAIT to the msgrcv function. (Well I should say, I can pass it that, but it's not making a difference...) Thanks,
      Post some code, I want to see hw you are importing the IPC_NOWAIT flag and the rest of the setup of the objects. Also what OS are you doing this on?


      -Waswas
        This is FreeBSD 5.1, perl 5.6.1.
        use IPC::SysV qw(IPC_PRIVATE IPC_CREAT S_IRWXU); $id = msgget(4335, IPC_CREAT | S_IRWXU); $go = 1; while($go){ if(msgrcv($id, $rcvd, 512, 0, IPC_NOWAIT)){ ($typ_rcvd, $rcvdData) = unpack("l! a*", $rcvd); print "Got------>$rcvdData\n"; } print "Wait\n"; sleep 1; }
        Thanks for your help.