Inter Application Communication HELP!!!

Discussion in 'C++' started by jsideburns@yahoo.ca, Dec 14, 2004.

  1. Guest

    Hello folks,

    I have 2 different applications: an MFC/C++ one and a pure C/C++
    generated from simulink. They talk to each other using UDP packets.

    Problem: the communication is too slow and I want to bypass the
    network card. If both processes are running on the same computer they
    still need a network card so that packets can be sent to the local
    host. If the network card is disabled no communication occurs.

    I can't seem to use simple messages like WM_COPYDATA because the
    second app has no window handle to get hold of.

    The apps need to send AND receive messages between each other. The
    messages themselves are small and don't vary in size.

    Any suggestions at all would be appreciated.

    Cheers js.
     
    , Dec 14, 2004
    #1
    1. Advertising

  2. wrote:
    > I have 2 different applications: an MFC/C++ one and a pure C/C++
    > generated from simulink. They talk to each other using UDP packets.
    >
    > Problem: the communication is too slow and I want to bypass the
    > network card. If both processes are running on the same computer they
    > still need a network card so that packets can be sent to the local
    > host. If the network card is disabled no communication occurs.
    >
    > I can't seem to use simple messages like WM_COPYDATA because the
    > second app has no window handle to get hold of.
    >
    > The apps need to send AND receive messages between each other. The
    > messages themselves are small and don't vary in size.
    >
    > Any suggestions at all would be appreciated.


    news:comp.os.ms-windows.programmer.win32
    news:comp.os.mw-windows.programmer.networks
    news:microsoft.public.win32.programmer.networks

    V
     
    Victor Bazarov, Dec 14, 2004
    #2
    1. Advertising

  3. Swampmonster Guest

    > Problem: the communication is too slow and I want to bypass the
    > network card. If both processes are running on the same computer they
    > still need a network card so that packets can be sent to the local
    > host. If the network card is disabled no communication occurs.


    Open a command-shell.
    Disable all network interface adapters.
    Type ping 127.0.0.1[enter].
    Be happy.

    'monster
     
    Swampmonster, Dec 14, 2004
    #3
  4. Re: [OT] Inter Application Communication HELP!!!

    wrote:
    >
    > The apps need to send AND receive messages between each other. The
    > messages themselves *** are small and don't vary in size ***.
    >


    So why not use files? If the messages are small, assuming
    reasonable file-caching by the kernel, I presume it would
    work, unless you have LOTS of these messages pending.

    HTH,
    - J.

    PS. You're in a wrong newsgroup, here we only deal with the
    C++ language as defined by the Holy Standard and are rather
    picky about that.
     
    Jacek Dziedzic, Dec 14, 2004
    #4
  5. Paavo Helde Guest

    wrote in news:a701e809.0412141223.12653ab3
    @posting.google.com:

    > Hello folks,
    >
    > I have 2 different applications: an MFC/C++ one and a pure C/C++
    > generated from simulink. They talk to each other using UDP packets.
    >
    > Problem: the communication is too slow and I want to bypass the
    > network card. If both processes are running on the same computer they
    > still need a network card so that packets can be sent to the local
    > host. If the network card is disabled no communication occurs.


    Not really C++, but anyway. First, I had an impression that the loopback
    device (address 127.0.0.1) doesn't need any network adapter. Is this
    different for UDP?

    In Windows you can synchronise processes via named events or mutexes. As
    you are using UDP now I guess a mutex would do approximately the same. To
    have a more precise (no packet loss) control, the events are better
    suited. To pass any message you will need a shared memory area anyway.
    See:

    http://msdn.microsoft.com/library/default.asp?url=/library/en-
    us/fileio/base/creating_named_shared_memory.asp

    Access to the shared memory should be protected by mutexes or events:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-
    us/wcecoreos5/html/wce50coninterprocesssynchronization.asp

    Alternatively, you might want to look up the pipes mechanism:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-
    us/ipc/base/pipes.asp

    HTH
    Paavo
     
    Paavo Helde, Dec 15, 2004
    #5
  6. Evan Carew Guest

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Paavo,

    Paavo Helde wrote:
    > wrote in news:a701e809.0412141223.12653ab3
    > @posting.google.com:
    >
    >
    >>Hello folks,
    >>
    >>I have 2 different applications: an MFC/C++ one and a pure C/C++
    >>generated from simulink. They talk to each other using UDP packets.
    >>
    >>Problem: the communication is too slow and I want to bypass the
    >>network card. If both processes are running on the same computer they
    >>still need a network card so that packets can be sent to the local
    >>host. If the network card is disabled no communication occurs.

    >
    >
    > Not really C++, but anyway. First, I had an impression that the loopback
    > device (address 127.0.0.1) doesn't need any network adapter. Is this
    > different for UDP?

    No, however, performance on such software interfaces can vary greatly
    with OS.
    >
    > In Windows you can synchronise processes via named events or mutexes. As
    > you are using UDP now I guess a mutex would do approximately the same. To
    > have a more precise (no packet loss) control, the events are better
    > suited. To pass any message you will need a shared memory area anyway.
    > See:

    Syncro events can be enabled with sharred memory & a mutex or semaphore
    under UNIX as well. Additionaly, you can use signals and pipes.

    Evan
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.0.6 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

    iD8DBQFBwL/VpxCQXwV2bJARAj3+AKC5o2BVpd/JP8xrsG/UFltzobZ2TgCffRzv
    j9iJHZscX5pLaU5bXtiaqG4=
    =Dyrr
    -----END PGP SIGNATURE-----
     
    Evan Carew, Dec 15, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Knute Johnson
    Replies:
    0
    Views:
    844
    Knute Johnson
    Jun 27, 2003
  2. Jon A. Cruz
    Replies:
    0
    Views:
    754
    Jon A. Cruz
    Jun 28, 2003
  3. Sudsy
    Replies:
    0
    Views:
    985
    Sudsy
    Jun 28, 2003
  4. Frank D. Greco
    Replies:
    1
    Views:
    2,224
    Keeger
    Jun 30, 2003
  5. joerg
    Replies:
    0
    Views:
    421
    joerg
    Oct 13, 2003
Loading...

Share This Page