Have you tried using the [NonSerialized] attribute on Cell::m_matrix ?
Cheers,
-Shawn
http://www.arithex.com/
----- Original Message -----
From: "Peter Zahoran" <[EMAIL PROTECTED]>
Sent: Thursday, July 04, 2002 13:15
Subject: Sending diffgrams + remoting
Hi,
I have a rather architectural .net remoting-related question. I have a
server application, which maintains a huge matrix of cells and a set of
client applications that send requests to perform certain operations on
this matrix, and display the resulting matrix to the user.
Since the matrix is huge, and the processing is continuous (this is a
quite interactive application) I'd like to avoid sending over the whole
matrix to the client as a result of each single operation. I'd rather
keep a copy of the matrix on the client side, and send only updates on
the cells that have been affected by the last operation.
I'm quite confident about how to implement all the above. Where I run
into trouble is remoting. A few facts:
1. My matrix is marshaled by value, as I wish to send the whole matrix
to the client on the first time, not just a reference to it.
2. My cell classes are as well marshaled by value, for similar reasons:
I wish to send their state rather than a reference to them when sending
cell update info.
3. My cells hold a reference to their owner matrix, this is simply
required (makes my life a lot easier)
Thus, when If my message looks like this:
class Server
{
public void DoIt(out Cell[] affectedCells);
}
When the server returns from its DoIt() message, the whole matrix would
be sent back to the client, as it is referenced in the Cell array I send
back. On the other hand, the caller knows exactly what matrix these
cells belong to, as this matrix has been already associated with the
server class earlier.
I considered creating a separate class that would encapsulate difference
data of a cell only, but I'm too lazy. This class would look _exactly_
like my Cell class except for that few fields, including the owner
matrix reference.
The above mentioned Server class is itself a sort of workaround already,
as I am logically calling methods on a Matrix class, rather than on a
server associated with this matrix. The matrix class should be therefore
marshaled by ref, however then I would have trouble sending back that
_first_ copy of the whole matrix, when the client connects in.
So my questions are:
1. is there any way of selecting what should and what should _not_ be
serialized in the message stream?
2. do I absolutely have to write a custom marshaller for that?
3. if I have to, how would such a marshaller look like? How would it
select what data should be sent over the wire and what not?
4. is there any better architecture you can suggest?
Thanks for your help.
Peter Zahoran
You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.
You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.