how send messages between two proceses?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • _mario.lat

    how send messages between two proceses?

    hallo,
    I'd like to fork a process so I have 2 process: process A and process B.
    How can send A a message (array of values or a value) to B?
    how can B read the message?
    Thank you in advance for the time you'll spend for me.
    Mario.

  • Andy Hassall

    #2
    Re: how send messages between two proceses?

    On Sat, 27 Jan 2007 09:50:01 +0100, "_mario.lat " <_mario.lat@lib ero.itwrote:
    >I'd like to fork a process so I have 2 process: process A and process B.
    >How can send A a message (array of values or a value) to B?
    >how can B read the message?
    If you are actually forking (as opposed to exec'ing a new process), then
    forked processes share filehandles with their parent, so that's one way to
    communicate between them. Other methods may include:

    Simple command line parameters? http://php.net/system
    Pass data via stdin/stdout? http://php.net/proc_open
    Sockets? (UNIX, TCP, etc.) http://php.net/sockets

    Or see http://en.wikipedia.org/wiki/Inter-p..._communication for more.

    --
    Andy Hassall :: andy@andyh.co.u k :: http://www.andyh.co.uk
    http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

    Comment

    • Toby Inkster

      #3
      Re: how send messages between two proceses?

      _mario.lat wrote:
      I'd like to fork a process so I have 2 process: process A and process B.
      How can send A a message (array of values or a value) to B?
      Unix sockets, TCP, UDP, shared memory.
      how can B read the message?
      By listening on a socket (Unix sockets, TCP, UDP) or by continuous polling
      (shared memory).

      --
      Toby A Inkster BSc (Hons) ARCS
      Contact Me ~ http://tobyinkster.co.uk/contact

      Comment

      Working...