Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Remoting / August 2005

Tip: Looking for answers? Try searching our database.

Array Remoting

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MoriCristian - 04 Aug 2005 09:27 GMT
Hi everyone. I'm having troubbles in remoting an Int32 array.
All the data are correctly passed from the server to the client, but if in
the client I try to write an element of the array the data is not passed back
to the server.
Can anyone explain me why?

Thanks!
Erick Sgarbi - 05 Aug 2005 12:13 GMT
You can use remoting to mashalling data in 2 ways MarshallByRef and
MarshallByValue.

MarshallByValue is the process of serializing the entire graph of the
object and sending it to a remote host (client) where it will be
deserialized which at that point the object itself has a different
reference from the server and it is not the same object that was send
back to the remote host. If you make changes to the object on the client
nothing will happen with the server's object because they are different.

MarshallByRef is the ability to create an object on the server and
sending a proxy to the client which represents the remote object (a
stub) of the real object. When the client make calls to the proxy (like
calling a method or setting a property) messages are marshaled back to
the server and redirected to the real object.

In order to create a proxy (MarshallByRef) an object must inherit from
System.MarshallByRefObject (or System.ContextBoundObject) where if you
want to MarshallByValue the object must be serializable (Containt the
SerializableAttribute) or provide your own serialization.

The reason why your array does not change on the server is because
System.Array does not inherit from System.MarshallByRef moreover it is a
serializable type. The object you are changing is not the same object
sitting on the server consequently you are only changing a local copy.

Please refer to:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/h
awkremoting.asp


HTH
Erick Sgarbi
www.blog.csharpbox.com

> Hi everyone. I'm having troubbles in remoting an Int32 array.
> All the data are correctly passed from the server to the client, but if in
[quoted text clipped - 3 lines]
>
> Thanks!

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.