in reply to Re: IPC Message Queues with IPC_NOWAIT
in thread IPC Message Queues with IPC_NOWAIT

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,
  • Comment on Re: Re: IPC Message Queues with IPC_NOWAIT

Replies are listed 'Best First'.
Re: Re: Re: IPC Message Queues with IPC_NOWAIT
by waswas-fng (Curate) on Dec 09, 2003 at 19:52 UTC
    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.
        Where do you think you were setting IPC_NOWAIT from? try using strict.
        use IPC::SysV qw(IPC_PRIVATE IPC_CREAT S_IRWXU IPC_NOWAIT); $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; }


        -Waswas