Interprocess data exchange

  • Thread starter Thread starter Tamir Khason
  • Start date Start date
T

Tamir Khason

What is the preferred way to exchange data between processes?
Example:
I have 2 applications (C#)
1) WinForms (A)
2) Command Line (B)
Both od them use DataLayer (class library) C

A calls to run B (via exec)
B loads data into C
A reads data from C

How to tell C to save data and serve both of applications (A+B)
Right now A told than the class in C empty from the data....




Thank you\
 
I do not need remoting
I have both of them on the same computer...
Are there other ways to bound into process and retrive the information in
runtime?
 
No, remoting is pretty much all .net offers in this case.
Mind though, that it is designed for interprocess and not just intercomputer
communicaton.
Read the .net help files to find more.
 
You need remoting or some other IPC construct (i.e. Named Pipes, Mem Mapped
file, etc.) to talk between processes - even on the same box.
 
Every program runs in process boundries. Remoting is a way to remote objects
and member calls across those process boundries. It doesn't matter if the
processes are physically on the same or different computers.

Even inteprocess calls in COM follow the same marshalling principals that
remoting follows. The difference is in the implementation. Remoting works
with TCP sockets (by default), and interprocess COM calls on the same
computer work via wndproc messages on hidden windows. Interprocess COM calls
on different computers uses RPC library calls on sockets (by default).

-Rob Teixeira [MVP]
 
Could you run IIS and use web services?

Tamir Khason said:
I do not need remoting
I have both of them on the same computer...
Are there other ways to bound into process and retrive the information in
runtime?
 
Can you provide examples of using remoting with custom channels.
I tried to find it, but with no success
 
From the other point of view all .NET proceses run in the same memory space.
Why not to use it?
 
I guess you are a little confused.
There is no such thing as a .NET process, on windows you only have Win32
processes each of them running in their own process space. A win32 process
can have one or more application domains created/managed by the CLR which is
loaded in that process whenever the first .NET application gets loaded.
Applications loaded into different domains within the same process can use
remoting to cross the Application domain boundaries, so we can say that (one
of) the .NET way(s) to call into another domain is "remoting", irrespective
the location of the other application domain:
- in the same process,
- another process on the same
- another process on a remote machine

Willy.
 
What kind of custom channels are you thinking about? You can write your
own, however you probably would be better off with a book like Advanced .Net
Remoting if you want to go down that route. hth
 
Hi Tamir,

I think there maybe someting wrong of your understanding of .Net
applications. In .Net an applicaiton runs in an AppDomain. While several
appdomain consist of a process. So 2 .Net application can be run in the
same process but 2 different appdomain, or 2 processes and 2 different
processes(Either the same machine or different machine).
So .Net applications did not run in the same memory space, and the
communication is a problem. In .Net, the recommanded communication
technical is Remoting.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top