Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

interprocess communication

by Anonymous Monk
on Oct 01, 2011 at 13:44 UTC ( #929034=perlquestion: print w/ replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

i need to cretae a message queue for interprocess communication. i ma able to generate key as shown below $msgkey = IPC::SysV::ftok("$APPSYS/runner/.runnerrc$NODE", 1); variables are specific o my system. but when i am trying to generate queue identifier like $msgID = msgget($msgkey, IPC_CREAT | S_IRWXU); its failing ..i am not getting any value for $msgID.it throws Illegal seek error . Can nayone pls propose a solution Thank you

Comment on interprocess communication
Re: interprocess communication
by Marshall (Prior) on Oct 01, 2011 at 15:03 UTC
    No. No thank you. Your post shows a lot of disrespect for the forum.

    Update: It was wrong for me to have said that - too aggressive. I will say that the best way to generate lots of helpful suggestions here is to be polite.

    Being polite means among other things, just taking the time to correct and use the spell checker suggestions before your post si sic("is") finalized.

      Well, more to the point, it at-least does not give anyone enough specific detail to act upon. Short code-snippets (or longer ones prepared as per "Markup in the Monastery") are needed. And of course it's often the case that while you are preparing those snippets, you spot the bug... "duh, never mind."
Re: interprocess communication ($!)
by tye (Cardinal) on Oct 02, 2011 at 01:15 UTC
    it throws Illegal seek error.

    I doubt that. Perl's msgget() never 'throws', it just returns undef to indication failure. If you are printing an error message that include $! that then say "Illegal seek", that likely has little to do with your call to msgget(). The underlying system's msgget(2) doesn't appear to be able to fail for that reason.

    Most likely, you are reporting $! even though msgget() didn't actually fail or you are doing too much before $! is output such that the value of $! gets overwritten.

    - tye        

Re: interprocess communication
by Khen1950fx (Canon) on Oct 02, 2011 at 04:42 UTC
    I think that you're seeing a warning, not an error. Try it without the warnings pragma.
    #!/usr/bin/perl -l use strict; use IPC::SysV qw(ftok IPC_CREAT S_IRWXU); my $key = ftok("/tmp/sometest.pl", 'A'); print my $id = msgget($key, IPC_CREAT | S_IRWXU );

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://929034]
Approved by planetscape
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2014-07-28 22:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (210 votes), past polls