Re: Can a stream be remoted to a guest
- From: "Günter Prossliner" <g.prossliner/gmx/at>
- Date: Mon, 21 May 2007 10:08:43 +0200
Hi!
and then hands the stream back to the caller ...
Allthough a Stream can be used as a Return-Value or a Parameter within a
Method called by the Remote Side, the behavior may not be the one that is
expected.
A Stream is derived from MarshalByRefObject. So:
1. The Object only lives on the Server
2. Methods invoked on the stream are serialized from the Client to the
Server
3. The Return - Values (or out/ref Parameters are serialized back to the
Client)
So if you read 100 times from the Stream, there are at leased 100
Roundtripps.
When the files are "small" you may read them into a byte[] completely, and
transfer this to the client,
or you may use System.Net to open a NetworkStream. The client connects to
the Endpoint (and than has it's own Network-Stream instance). You may
transfer the data needed to open the connection (IP-Address, Port) by an
Remoting-Method. For the Data-Exchange itself, there is no remoting
involved; just simple TCP.
GP
.
- Prev by Date: Remoting Questions
- Next by Date: AuthenticationException when calling a method on the proxy to a distant server - URGENT
- Previous by thread: Remoting Questions
- Next by thread: AuthenticationException when calling a method on the proxy to a distant server - URGENT
- Index(es):
Relevant Pages
|
Loading