in reply to Re: Resizing IPC::Msg queue size
in thread Resizing IPC::Msg queue size
Unfortunately, it fails. Given the code below, I get
If I remove the set call, everything seems to work except the queue being too small. What am I missing?[jps@secanaws jps]$ perl ipc-write.pl Can't call method "pack" on an undefined value at /usr/lib/perl5/5.6.1 +/i386-linux/IPC/Msg.pm line 78.
#!/usr/bin/perl use IPC::SysV qw(IPC_PRIVATE IPC_CREAT IPC_NOWAIT); use IPC::Msg; use Data::Dumper; use strict; use warnings; my $msgtype = 1; my $message = "hello nr "; my $messages = 2000; my $buf; my $msg = new IPC::Msg('24h', IPC_CREAT); $msg->set('qbytes' => 32768); for (my $i = 0; $i < $messages; $i++) { my $rv = $msg->snd($msgtype, pack("L a*",$msgtype,$message . $i), IPC_NOWAIT); print "rv of $i is $rv\n" } while ($msg->rcv($buf,256, $msgtype, IPC_NOWAIT)) { print "$buf\n"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Resizing IPC::Msg queue size
by hv (Prior) on Jul 08, 2004 at 12:50 UTC | |
by Jeppe (Monk) on Jul 08, 2004 at 13:15 UTC | |
Re^3: Resizing IPC::Msg queue size
by gellyfish (Monsignor) on Jul 08, 2004 at 10:03 UTC | |
by Jeppe (Monk) on Jul 08, 2004 at 10:19 UTC |
In Section
Seekers of Perl Wisdom