473,406 Members | 2,619 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

IPC advice

Dear all,
my application runs in 2 processes on the same machine. Now I need to send a
string from one process to another. One process is managed other is native.
The communication should work on any computer (even with firewalls)
I could write file in one process and read it in other but it seems to be
bad solution.
Could somebody advice me about the simple and fast solution.
Thanks a lot.
Mar 13 '06 #1
11 1072
> Dear all,
my application runs in 2 processes on the same machine. Now I need to send a
string from one process to another. One process is managed other is native.
The communication should work on any computer (even with firewalls)
I could write file in one process and read it in other but it seems to be
bad solution.
Could somebody advice me about the simple and fast solution.
Thanks a lot.


If it has to work on different computers, regardless of firewall settings,
the best option is to use TCP sockets.
one process acts as a server and allows an incoming connection on a specific
port. the other process connects.
Then they can send data to each other.

I have used winsock (which is unmanaged) in the past like this in a windows
service, and it worked great. this way the different computers don't even
have to run the same OS. UNIX and windows can work together that way without
any problem.

You can use winsock in your unmanaged app, and TcpChannel in your managed app.
For unmanaged you can probably also use MFC classes, but i've never used
those.

--

Kind regards,
Bruno.
br**********************@hotmail.com
Remove only "_nos_pam"
Mar 13 '06 #2
Dear Bruno,
it does not have to work on different computers, both parts always run on
the same PC. Is there a better option or do you still advice to use sockets?
Thanks a lot,
Mar 13 '06 #3
Is the string always of the same size and not too big? If yes, you could
implement a DLL with a shared segment. This is by far the fastest option,
because both processes would effectively share the same physical memory.


"Boni" <no****@parampam.pam> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Dear Bruno,
it does not have to work on different computers, both parts always run on
the same PC. Is there a better option or do you still advice to use
sockets?
Thanks a lot,

Mar 13 '06 #4
> Dear Bruno,
it does not have to work on different computers, both parts always run on
the same PC. Is there a better option or do you still advice to use sockets?
Thanks a lot,


Since you mentioned 'on any computer, regardless of firewall settings' i
assumed that you wanted to use different computers.

The advantage of using sockets is that there is no limitation to what you
can send (types of data, size of data, ...) and you can seamlesly move
applications to different computers.

If you are sure that different computers are never necessary, there are
simpler options like pipes for example.

you can find a good overview here:
http://msdn.microsoft.com/library/de...unications.asp

--

Kind regards,
Bruno.
br**********************@hotmail.com
Remove only "_nos_pam"

Mar 13 '06 #5
Look here [1] for a desciption of shared segments. You may also want to read
the documentation of #pragma segment and __declspec(allocate)

http://msdn.microsoft.com/library/de...er_dlls.3f.asp

"Marcus Heege" <NO****@heege.net> wrote in message
news:O1***************@TK2MSFTNGP10.phx.gbl...
Is the string always of the same size and not too big? If yes, you could
implement a DLL with a shared segment. This is by far the fastest option,
because both processes would effectively share the same physical memory.


"Boni" <no****@parampam.pam> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Dear Bruno,
it does not have to work on different computers, both parts always run on
the same PC. Is there a better option or do you still advice to use
sockets?
Thanks a lot,


Mar 13 '06 #6
Just before I knew nothing about the topic and now I have a full overview.
Thanks a lot Bruno and Marcus for sharing this.
"Bruno van Dooren" <br**********************@hotmail.com> schrieb im
Newsbeitrag news:B0**********************************@microsof t.com...
Dear Bruno,
it does not have to work on different computers, both parts always run on
the same PC. Is there a better option or do you still advice to use
sockets?
Thanks a lot,


Since you mentioned 'on any computer, regardless of firewall settings' i
assumed that you wanted to use different computers.

The advantage of using sockets is that there is no limitation to what you
can send (types of data, size of data, ...) and you can seamlesly move
applications to different computers.

If you are sure that different computers are never necessary, there are
simpler options like pipes for example.

you can find a good overview here:
http://msdn.microsoft.com/library/de...unications.asp

--

Kind regards,
Bruno.
br**********************@hotmail.com
Remove only "_nos_pam"

Mar 13 '06 #7
Hi Marcus,
How do I notify another process, that it is time to take data?

"Marcus Heege" <NO****@heege.net> schrieb im Newsbeitrag
news:O1***************@TK2MSFTNGP10.phx.gbl...
Is the string always of the same size and not too big? If yes, you could
implement a DLL with a shared segment. This is by far the fastest option,
because both processes would effectively share the same physical memory.


"Boni" <no****@parampam.pam> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Dear Bruno,
it does not have to work on different computers, both parts always run on
the same PC. Is there a better option or do you still advice to use
sockets?
Thanks a lot,


Mar 13 '06 #8
Look for the documentation of the CreateEvent, SetEvent, WaitForSingleObject
and CloseHandle APIs. An event in as named cross proccess OS object that can
be used for thread serialization. You can see an event like a boolean flag.
The receiver of the data can block its thread (WaitForSingleObject) until
the boolean flag is set to true by the sender thread (SetEvent).

In the MSDN documentation you should find a sample application.

Marcus

"Boni" <no****@parampam.pam> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi Marcus,
How do I notify another process, that it is time to take data?

"Marcus Heege" <NO****@heege.net> schrieb im Newsbeitrag
news:O1***************@TK2MSFTNGP10.phx.gbl...
Is the string always of the same size and not too big? If yes, you could
implement a DLL with a shared segment. This is by far the fastest option,
because both processes would effectively share the same physical memory.


"Boni" <no****@parampam.pam> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Dear Bruno,
it does not have to work on different computers, both parts always run
on the same PC. Is there a better option or do you still advice to use
sockets?
Thanks a lot,



Mar 13 '06 #9
It does not sound easy :(.
What I need is:
Proc1 requests data (sends address to Proc2)
Proc2 sends data back.
The speed is important.
Is there no easier solution?
"Marcus Heege" <NO****@heege.net> schrieb im Newsbeitrag
news:%2****************@tk2msftngp13.phx.gbl...
Look for the documentation of the CreateEvent, SetEvent,
WaitForSingleObject and CloseHandle APIs. An event in as named cross
proccess OS object that can be used for thread serialization. You can see
an event like a boolean flag. The receiver of the data can block its
thread (WaitForSingleObject) until the boolean flag is set to true by the
sender thread (SetEvent).

In the MSDN documentation you should find a sample application.

Marcus

"Boni" <no****@parampam.pam> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi Marcus,
How do I notify another process, that it is time to take data?

"Marcus Heege" <NO****@heege.net> schrieb im Newsbeitrag
news:O1***************@TK2MSFTNGP10.phx.gbl...
Is the string always of the same size and not too big? If yes, you could
implement a DLL with a shared segment. This is by far the fastest
option, because both processes would effectively share the same physical
memory.


"Boni" <no****@parampam.pam> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Dear Bruno,
it does not have to work on different computers, both parts always run
on the same PC. Is there a better option or do you still advice to use
sockets?
Thanks a lot,



Mar 13 '06 #10

"Boni" <no****@parampam.pam> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
It does not sound easy :(.
What I need is:
Proc1 requests data (sends address to Proc2)
Proc2 sends data back.
The speed is important.
Is there no easier solution?

This sounds pretty much like a socket application. Sockets exist in managed
and native APIs. So this should be doable.
Mar 13 '06 #11
AP
Guys. First of all the programming was never easy. Second: looking for
answers in some goups without having loooked through MSDN is nonsense.
Nobody will fill your head with knowlege you suppose to earn. Moreover. Even
if you think you have picked up some knowlege without earning - you will
fail horobly. Now, READ the MSDN, take examples, create your own application,
compile , run and fail till you fix it.
NOBODY WILL DO IT FOR YOU !!! never.
May 28 '06 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

75
by: Howard Nease | last post by:
Hello, everyone. I would appreciate any advice that someone could give me on my future career path. Here is my situation: I am a bright Junior in a very well-respected private high school, taking...
5
by: Martin Piper | last post by:
Hi all. I've recently landed myself the position of trainee C++ programmer which I'm extremely pleased about, but also nervous. According to the feedback from the interview, I have a good...
3
by: Andy Dingley | last post by:
I've just started on a new project and inherited a huge pile of XSLT (and I use the term "pile" advisedly !) It runs at glacial speed, and I need to fix this this. Platform is MSXML 4 / ASP ...
11
by: ma740988 | last post by:
I'm perusing a slide with roughly 12 bullets spread across 3 pages. Each bullet reflects 'advice'. I'm ok with all but 1 bullet, more specifically the bullet that states: " Avoid the STL unless...
6
by: J Rieggle | last post by:
Hi there, I am stuck on a problem that relates to eCommerce sites, but isnt ASP.NET specific (sorry). The ecommerce site is working in the UK, and products will be sold in pounds stirling. ...
13
by: Alan Silver | last post by:
Hello, MSDN (amongst other places) is full of helpful advice on ways to do data access, but they all seem geared to wards enterprise applications. Maybe I'm in a minority, but I don't have those...
7
by: John Paul | last post by:
I'm thinking of building an e-commerce site in php. Anyone got any advice in building one? What is the best way to implement a payment system? Are any legal issues involved? Thanks,
232
by: robert maas, see http://tinyurl.com/uh3t | last post by:
I'm working on examples of programming in several languages, all (except PHP) running under CGI so that I can show both the source files and the actually running of the examples online. The first...
3
by: mesut | last post by:
Hi colleagues, I need your advice... I have approx 1,5 years experience with ASP.NET/VB.NET 2005 and I have to switch over into C# 2005 language. I don't have experience with C# 2005...
7
by: SM | last post by:
Hello, I have a index.php template (2 columns). The right columns contains a bunch of links (interviews, poems, etc...) The left columns contains the actual article. So if I click on a link on...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.