rawCoder said:
'Serializing variable length string across app domains'
Hi All,
Well I looked into the serialization stuff and seems that the default
serialization of .NEt isnt good enuf for me due to space problem.
the one that suits me most is with the help of Marshal.StructureToPtr
Its concise and good but there is one problem.
In case of unknow length strings , this will not work when the serialization
and de-serialization is done across app domains - as in case of socket apps.
see the structure at the bottom
If there is no direct solution, then I will have to do ALL the serialization
by myself without help from .NET :'-(
Then I will actually not be sending the original objects over network,
rather will be getting the fields out and putting in a generic message with
message header to identify type of message and length and will be then
sending it. Any help in that case will also be appreciated
In reality, it is impossible to send objects anywhere. They only exist in
memory. As far as applications are concerned, they only exist in the
virutal address space of the process in which they were created. Any idea of
object transfer is going to consist of creating a new object that is the
same type as your source object at your destination location and setting its
state to that of your source object.
I am actually in the same boat as you are. I need a PocketPC to talk to a
windows service written in C#. Even if I use the .Net Compact Frame work on
the PocketPC there is no remoting or serialization available. There is also
no DCOM for PocketPC.
Some of the things I am thinking about are:
1. Is it too much work to setup a generic way to remote object over tcp/ip
(probably)
2. Is it too much work to remote a specific type of object over tcp/ip
(probably not)
a. Create a proxy object
b. Create a stub object
c. Create a specific protocol that will allow me to mirror object state
and perform remote method invocation.
3. Am I better off creating an application specific protocol to expose a set
of services over tcp/ip (perhaps).