shared data between 2 apps

tigz

Member
Joined
May 21, 2003
Messages
21
hi,

im doing a bit of preparation for my uni project that im currently designing. Im just trying to think forward to my implementation so i know what i can design and what i cant now.

i need my asp.net application to be able to give a vb.net app, that is already running on the same computer as the asp.net application, some data. So basically a user can give data to the asp.net application through the web and then the data is passed to the vb.net application to deal with.

is it possible for a running application to pass data to another already-running application? i could just have the asp.net app dump the data in an xml file or database and get the vb.net application check that location every repetition for new instrucitons but its a bit untidy and id rather do it in memory somehow by having a shared data structure. the asp.net be able to find the vb.net apps datastructure, gain control of it and dump data in it.

ive read that an application that starts two threads within itself can have a shared data structure between the two threads but this is a seperate application trying to talk to another seperate application.

any suggestions?
 
The most important consideration to make is the contexts in which the applications are executing. The ASP.NET application is going to be running under the ASPNET system account and the VB.NET application will be running under the user account of your choice.

Assuming that barrier cant be eliminated and also remembering that the ASPNET system account has very limited access to the file system by default, we can determine that the best course of action would be to use a method that requires very few privileges: Windows sockets. This is the common method of communication between unequally privileged processes running on different accounts (or different machines) or as Windows services.
 
ok. i have a book on .net network programming, im sure that will cover sockets. i know the theory from working with java.

out of interest. what would be the best method of communication between two seperate VB.net applications? is there another method of communication for that situation?
 
There are a half-dozen methods that could be eimployed, but none really offer the same benefits as sockets do. Granted sockets arent the perfect solution, but they are by far the most used method of interprocess communication.
 
There is the common method of polling a file, [api]SendMessage[/api], [api]ReadProcessMemory[/api], DTE, a shared DLL, registry keys, RPC, pipes, COM servers... etc. None of these work well in a .NET environment however, and I strongly recommend against many, if not all of them. Socket-based interprocess communication under .NET is far more appropriate and wide spread.
 
I am in need of interprocess communications as well. These must be bidirectional and occur based on user interaction from either end (thus not fitting a client/server implementation so well).

Is the best way to do this to set up a client and a server in each apliaction and make them essential one way communications? Any examples of using sockets to do bi-direction user-initiated information.

For lack of a better example... 2 IM clients that want to talk to one another without the use of a server.

Spektre

Derek Stone said:
There is the common method of polling a file, [api]SendMessage[/api], [api]ReadProcessMemory[/api], DTE, a shared DLL, registry keys, RPC, pipes, COM servers... etc. None of these work well in a .NET environment however, and I strongly recommend against many, if not all of them. Socket-based interprocess communication under .NET is far more appropriate and wide spread.
 
try googling for MS Message Queue. MSMQ its called.
it might be a workable solution.
pretty straightforward to setup too.
 
you guys are way over complicating this i think.

Remoting is the perfect application model.

.net 2.0? IPC remoting.

here is an example I wote on the msdn forums for win app to win app, can be easily switched to make the client an asp.net application against a vb.net server.
 
Back
Top