By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,299 Members | 1,254 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,299 IT Pros & Developers. It's quick & easy.

Remoting (but need a binary data transfer)

P: n/a
Hi all,
I'm creating client/server app in C# (VS. 2003).
So, I need the client to call the server with some auth info (user and
pass).
If the auth is OK, server will do some work and will prepare a zip-file
and some other text and numeric data and will notify the client that
everything is ready.
And the client will fetch the data.

So if it was all console/desktop application, I know what to do (in
basic):

//server
class MyWorkClass
{
public string sRetData;
public int nRetData;
public byte[] aRetData;

public event I_AM_ready .... //
public bool Connect(string username, string pass)
{
if CheckAuth(username, pass)
{
DoTheWork();
sRetData = "HERE IS THE DATA";
nRetData = 1001; //just as example
aRetData = new byte[1000000];
aRetData = ...//fill it with data from the file
return true;
}
else return false;
}

private void DoTheWork()
{ ...
fire some events to show progress ... }

private bool CheckAuth(string u, string p)
{ ... }
}
//client
MyWorkClass myServer = new MyWorkClass();
// subscribe event handler
myServer.I_AM_Ready += ....
if (myServer.Connect(myname, mypass))
// do something with the data

So, can I use all these samples (tutorials, etc.for remoting) to do such
a thing? Is there a problem with the array?
Will it prepare a XML tag for every byte from the array (then the
traffic will be HUGE, and I want to avoid this)?

Also, I didn't find any info about what is happening at the server side,
is it creating a new instance of the class for every client, or there is
only one (like static) copy?
Thank you very very much for reading all this. I'd highly appreciate
every single suggestion, explanation, example, etc.

Thanks again
Sunny
Nov 15 '05 #1
Share this Question
Share on Google+
3 Replies

P: n/a

Hi Sunny,

Thank you for posting in this group.

You can fulfill you work with .Net Remoting.
In the server side, there are 3 ways of creating object for your request:
1.server side activation----singlecall
Create object instance for every request
2.server side activation----singleton
Create only one instance for all the request.
3.client side activaction
Create only one instance for the same client request

You can select different server side creation deside by your program logic.

Hope this helps

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: Sunny <su******@icebergwireless.com>
| Subject: Remoting (but need a binary data transfer)
| Date: Tue, 16 Sep 2003 15:50:28 -0500
| Message-ID: <MP************************@msnews.microsoft.com >
| Organization: Iceberg Wireless LLC
| MIME-Version: 1.0
| Content-Type: text/plain; charset="iso-8859-15"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: MicroPlanet Gravity v2.60
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: 216.17.90.91
| Lines: 1
| Path:
cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTN GXA05.phx.gbl!TK2MSFTNGP08
.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.languages.csharp:184665
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Hi all,
| I'm creating client/server app in C# (VS. 2003).
| So, I need the client to call the server with some auth info (user and
| pass).
| If the auth is OK, server will do some work and will prepare a zip-file
| and some other text and numeric data and will notify the client that
| everything is ready.
| And the client will fetch the data.
|
| So if it was all console/desktop application, I know what to do (in
| basic):
|
| //server
| class MyWorkClass
| {
| public string sRetData;
| public int nRetData;
| public byte[] aRetData;
|
| public event I_AM_ready .... //
| public bool Connect(string username, string pass)
| {
| if CheckAuth(username, pass)
| {
| DoTheWork();
| sRetData = "HERE IS THE DATA";
| nRetData = 1001; //just as example
| aRetData = new byte[1000000];
| aRetData = ...//fill it with data from the file
| return true;
| }
| else return false;
| }
|
| private void DoTheWork()
| { ...
| fire some events to show progress ... }
|
| private bool CheckAuth(string u, string p)
| { ... }
| }
|
|
| //client
|
|
| MyWorkClass myServer = new MyWorkClass();
| // subscribe event handler
| myServer.I_AM_Ready += ....
| if (myServer.Connect(myname, mypass))
| // do something with the data
|
|
|
| So, can I use all these samples (tutorials, etc.for remoting) to do such
| a thing? Is there a problem with the array?
| Will it prepare a XML tag for every byte from the array (then the
| traffic will be HUGE, and I want to avoid this)?
|
| Also, I didn't find any info about what is happening at the server side,
| is it creating a new instance of the class for every client, or there is
| only one (like static) copy?
|
|
| Thank you very very much for reading all this. I'd highly appreciate
| every single suggestion, explanation, example, etc.
|
| Thanks again
| Sunny
|

Nov 15 '05 #2

P: n/a
Hi Jeffrey,
Thanks a lot for the answer.
I still have no answer on the question about how the binary data is
transmitted (I.e. for sure it is some kind of XML), but it is important
for me to know how exactly look like the the binary stream, because I
have to transmit something like byte[300000], and ...

Thanks
Sunny
In article <HW**************@cpmsftngxa06.phx.gbl>, v-
je***@online.microsoft.com says...

Hi Sunny,

Thank you for posting in this group.

You can fulfill you work with .Net Remoting.
In the server side, there are 3 ways of creating object for your request:
1.server side activation----singlecall
Create object instance for every request
2.server side activation----singleton
Create only one instance for all the request.
3.client side activaction
Create only one instance for the same client request

You can select different server side creation deside by your program logic.

Hope this helps

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: Sunny <su******@icebergwireless.com>
| Subject: Remoting (but need a binary data transfer)
| Date: Tue, 16 Sep 2003 15:50:28 -0500
| So, can I use all these samples (tutorials, etc.for remoting) to do such
| a thing? Is there a problem with the array?
| Will it prepare a XML tag for every byte from the array (then the
| traffic will be HUGE, and I want to avoid this)?

Nov 15 '05 #3

P: n/a

Hi Sunny,

Do you use Marshal by reference or by value?
I think you should use tcp protocol and binary serialization this object,
then
you performance will be better.
The HTTP will use the SOAP serialization.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: Sunny <su******@icebergwireless.com>
| Subject: RE: Remoting (but need a binary data transfer)
| Date: Wed, 17 Sep 2003 09:13:19 -0500
| Message-ID: <MP************************@msnews.microsoft.com >
| References: <MP************************@msnews.microsoft.com >
<HW**************@cpmsftngxa06.phx.gbl>
| Organization: Iceberg Wireless LLC
| MIME-Version: 1.0
| Content-Type: text/plain; charset="iso-8859-15"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: MicroPlanet Gravity v2.60
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: 216.17.90.91
| Lines: 1
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP09.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:185502
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Hi Jeffrey,
| Thanks a lot for the answer.
| I still have no answer on the question about how the binary data is
| transmitted (I.e. for sure it is some kind of XML), but it is important
| for me to know how exactly look like the the binary stream, because I
| have to transmit something like byte[300000], and ...
|
| Thanks
| Sunny
|
|
| In article <HW**************@cpmsftngxa06.phx.gbl>, v-
| je***@online.microsoft.com says...
| >
| > Hi Sunny,
| >
| > Thank you for posting in this group.
| >
| > You can fulfill you work with .Net Remoting.
| > In the server side, there are 3 ways of creating object for your
request:
| > 1.server side activation----singlecall
| > Create object instance for every request
| > 2.server side activation----singleton
| > Create only one instance for all the request.
| > 3.client side activaction
| > Create only one instance for the same client request
| >
| > You can select different server side creation deside by your program
logic.
| >
| > Hope this helps
| >
| > Best regards,
| > Jeffrey Tan
| > Microsoft Online Partner Support
| > Get Secure! - www.microsoft.com/security
| > This posting is provided "as is" with no warranties and confers no
rights.
|
|
|
| > --------------------
| > | From: Sunny <su******@icebergwireless.com>
| > | Subject: Remoting (but need a binary data transfer)
| > | Date: Tue, 16 Sep 2003 15:50:28 -0500
| > | So, can I use all these samples (tutorials, etc.for remoting) to do
such
| > | a thing? Is there a problem with the array?
| > | Will it prepare a XML tag for every byte from the array (then the
| > | traffic will be HUGE, and I want to avoid this)?
|

Nov 15 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.