| Topic: |
DEVELOP > c-Plus-Plus |
| User: |
"" |
| Date: |
14 Dec 2004 02:23:21 PM |
| Object: |
Inter Application Communication HELP!!! |
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.
.
|
|
| User: "Paavo Helde" |
|
| Title: Re: Inter Application Communication HELP!!! |
15 Dec 2004 04:24:09 PM |
|
|
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
.
|
|
|
| User: "Evan Carew" |
|
| Title: Re: Inter Application Communication HELP!!! |
15 Dec 2004 04:50:59 PM |
|
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Paavo,
Paavo Helde wrote:
jsideburns@yahoo.ca 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-----
.
|
|
|
|
|
| User: "Jacek Dziedzic" |
|
| Title: Re: [OT] Inter Application Communication HELP!!! |
14 Dec 2004 03:52:37 PM |
|
|
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.
.
|
|
|
|
| User: "Victor Bazarov" |
|
| Title: Re: Inter Application Communication HELP!!! |
14 Dec 2004 02:45:16 PM |
|
|
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
.
|
|
|
|
| User: "Swampmonster" |
|
| Title: Re: Inter Application Communication HELP!!! |
14 Dec 2004 03:48:18 PM |
|
|
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
.
|
|
|
|

|
Related Articles |
|
|