Click here to Skip to main content
16,015,504 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
dear visual basic .NET collegues,

I am using named pipes to communicate between processes.
I am able to pass unstructured messages between client and server.

However, I would need to transfer a complete structure.

How can this be done ?

thanks for your much appreciated help,

guido
Posted

If you had mentioned WCF, I'd say you could just go ahead and pass your objects as with a normal method call but since you haven't I can only assume that you've rolled your own named pipes connection.

If that is the case, I'd serialize your data and pass it as a string, then deserialize it on the other side. You could either pass a string representation of the serialized Xml or the equivalent base64 string.

More info:

http://msdn.microsoft.com/en-gb/library/vstudio/ms233843%28v=vs.100%29.aspx[^]

and:

http://msdn.microsoft.com/en-us/library/7ay27kt9%28v=vs.100%29.aspx[^]

hope it helps.
 
Share this answer
 
It does not matter where you want to pass such structure. All it matters is to have serialization for the structure. Please see:
http://en.wikipedia.org/wiki/Serialization[^],
http://msdn.microsoft.com/en-us/library/7ay27kt9%28v=vs.110%29.aspx[^].

One important approach to serialization is Data Contract. Please see:
http://msdn.microsoft.com/en-us/library/ms733127.aspx[^].

By the way, you don't have to use named pipes at low lever programming named pipe access directly. It can use either "classical" .NET remoting or WCF (especially, self-hosted). In both technologies, you can use so called IPC channel and pass it to serialization mechanism. Such channels are based on named pipes and can be use for messaging between different processes, that's why such channels has the same name as the more general term "Inter-Process Communication" (IPC). Please see:
http://msdn.microsoft.com/en-us/library/vstudio/72x4h507%28v=vs.100%29.aspx[^],
http://msdn.microsoft.com/en-us/library/vstudio/8119f66k%28v=vs.100%29.aspx[^];
http://msdn.microsoft.com/en-us/library/ms729840.aspx[^],
http://msdn.microsoft.com/en-us/library/vstudio/xcs3s8f3%28v=vs.100%29.aspx[^],
http://msdn.microsoft.com/en-us/library/vstudio/4b3scst2%28v=vs.100%29.aspx[^].

See also: http://en.wikipedia.org/wiki/Inter-process_communication[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900