[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

Bandwidth - Your experience?

Stewart Stevens

6/3/2004 1:16:00 AM

I have been trying to use the .NET Remoting framework....with some success!
I have been considering a raw socket implementation but if the Remoting
framework does the job its flexibility, ease of use, and the time saved
devleoping some nice socket code would seem to win the day. Performance is
an issue for me.

Now that I've got it all basically working the bandwidth I am getting is
about 2 mbs. (mega bits per second). This is measured with a single client
connecting to the remote server. Is this in line with your experience?

Today I'm going to profile the code and see where its spending the time and
if there is anything I can do. This bandwidth is a bit touch and go for my
application ... I'd really like to see at least 10mbs. Should I be able to
achieve this?

Here's what I'm doing:

I'm moving managed arrays of DataRange objects accross the remote
interface...I have an Enumeration Class that is derived from MarshalByRef
that fills a provided array with data.

To move 14,892 DataRange objects (each of which is 8 bytes long) takes about
.45 seconds (first couple of transfers take a little longer). So 14892 * 8 *
8 / 0.45 is how I arrive at the 2mbs figure.
typedef float DataValue;

[Serializable] [StructLayout(LayoutKind::Sequential)]public __value class
DataRange
{ ...
DataValue mMinimum;

DataValue mMaximum;

};

public __gc __interface IRangeEnumerator

{...

int Next(unsigned long n, [Out] DataRange items[], long offset);

};

public __gc class RangeEnumerator : public IRangeEnumerator, public
MarshalByRefObject

{ ...



int Next(unsigned long n, DataRange items[], long offset);

... };

I set up the remote service like this:



BinaryServerFormatterSinkProvider *serverProv = new
BinaryServerFormatterSinkProvider();

BinaryClientFormatterSinkProvider *clientProv = new
BinaryClientFormatterSinkProvider();

IDictionary *props = new Hashtable();

serverProv->TypeFilterLevel = TypeFilterLevel::Full;

props->Add(S"port",__box(9080));

TcpChannel *channel = new TcpChannel(props, clientProv,serverProv);

ChannelServices::RegisterChannel(channel);

RemotingServices::Marshal(mServer, S"Server");