[Mono-dev] .NET Remoting: Upload of a file from a Win32 MS .NET client to a Linux Mono .NET server.

Sunny sloncho at gmail.com
Fri Sep 2 17:15:48 EDT 2005


Sorry, replied off the list, here is a copy:


On 9/2/05, Yngve Zackrisson <yngve.zackrisson at mobila-kontoret.se> wrote:
> Hi there.
>

> The problems (now) arise when i try to upload a zip file from
> the client to the server.
> I use a parameter with a (File)Stream object to do "callbacks"

I did not check all your code, but generally this is a bad idea to
pass a Stream object as remoting parameter. That way, when you invoke
a remote call lets say to Read method, you are passing the buffer
array as well in both directions, thus doubling the traffic.

A better approach is to have a remote method like byte[] ReadChunk(int
start, int end) or something like that. Now, you can control from the
client how big chunks you want to receive, and the buffer is only
passed from server to client. Knowing the original size of the file
and the chunks/bytes you already read, you can easily maintain and
update a progress indicator.

This is a good article on the topic:
http://www.genuinechannels.com/Content.aspx?id=23&type=1

Cheers
Sunny

--
Svetoslav Milenov (Sunny)



More information about the Mono-devel-list mailing list