Inter Application Communication HELP!!!

J

jsideburns

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.
 
V

Victor Bazarov

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.


V
 
S

Swampmonster

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
 
J

Jacek Dziedzic

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.
 
P

Paavo Helde

(e-mail address removed) wrote in @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
 
E

Evan Carew

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

Paavo,

Paavo said:
(e-mail address removed) wrote in @posting.google.com:




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-----
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,152
Members
46,697
Latest member
AugustNabo

Latest Threads

Top