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

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

Replies are listed 'Best First'.
Re: Re: Re: Re: IPC Message Queues with IPC_NOWAIT
by CB900F (Initiate) on Dec 09, 2003 at 20:13 UTC
    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
        DUH!!! You are the man. Appreciate the help and I'm going to go hide in shame. Thanks again.