Re: Can a stream be remoted to a guest



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


.



Relevant Pages

  • Re: How do I stop a Winsock from buffering characters?
    ... it's applied at the OS level to the socket. ... Stream s = client.GetStream; ... from the client code and have the server see it right away. ... first character of the client send. ...
    (microsoft.public.windowsce.embedded)
  • Re: How do I stop a Winsock from buffering characters?
    ... The client is just doing this to send: ... Stream s = client.GetStream; ... I just wan to send one character ... from the client code and have the server see it right away. ...
    (microsoft.public.windowsce.embedded)
  • Re: Is this the correct way to send a Bitmap over sockets?
    ... clickpoints) from the server to the client. ... indicating that the Socket was closed. ... "logical" stream ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: How do I stop a Winsock from buffering characters?
    ... Stream s = client.GetStream; ... I just wan to send one character at a time ... from the client code and have the server see it right away. ... I don't see the server reads that you're talking about as having dropped the ...
    (microsoft.public.windowsce.embedded)
  • Re: Client Server
    ... Otherwise, read a file in via a stream, make any required updates, and write ... > myself and compares it to the data that the client has sent to ... My response, though it was very general in nature, assumed exactly what you ... at some point you want the server to read this file in. ...
    (comp.lang.java.help)

Loading