473,756 Members | 4,511 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Remoting (but need a binary data transfer)

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(usern ame, 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(strin g u, string p)
{ ... }
}
//client
MyWorkClass myServer = new MyWorkClass();
// subscribe event handler
myServer.I_AM_R eady += ....
if (myServer.Conne ct(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
3 2274

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******@icebe rgwireless.com>
| Subject: Remoting (but need a binary data transfer)
| Date: Tue, 16 Sep 2003 15:50:28 -0500
| Message-ID: <MP************ ************@ms news.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.publi c.dotnet.langua ges.csharp
| NNTP-Posting-Host: 216.17.90.91
| Lines: 1
| Path:
cpmsftngxa07.ph x.gbl!cpmsftngx a10.phx.gbl!TK2 MSFTNGXA05.phx. gbl!TK2MSFTNGP0 8
.phx.gbl!TK2MSF TNGP12.phx.gbl
| Xref: cpmsftngxa07.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1846 65
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.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(usern ame, 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(strin g u, string p)
| { ... }
| }
|
|
| //client
|
|
| MyWorkClass myServer = new MyWorkClass();
| // subscribe event handler
| myServer.I_AM_R eady += ....
| if (myServer.Conne ct(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
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.mi crosoft.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******@icebe rgwireless.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

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******@icebe rgwireless.com>
| Subject: RE: Remoting (but need a binary data transfer)
| Date: Wed, 17 Sep 2003 09:13:19 -0500
| Message-ID: <MP************ ************@ms news.microsoft. com>
| References: <MP************ ************@ms news.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.publi c.dotnet.langua ges.csharp
| NNTP-Posting-Host: 216.17.90.91
| Lines: 1
| Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP09.phx.g bl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1855 02
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.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.mi crosoft.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******@icebe rgwireless.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3292
by: bettervssremoting | last post by:
To view the full article, please visit http://www.BetterVssRemoting.com Better VSS Remote Access Tool including SourceOffSite, SourceAnyWhere and VSS Remoting This article makes a detailed comparison among SourceAnyWhere, SourceOffSite, VSS Remoting and possible others.
6
2716
by: Uttam | last post by:
Hello, We are at a very crucial decision making stage to select between .Net and Java. Our requirement is to download a class at runtime on the client computer and execute it using remoting or rmi. Just to keep my question short I am posting trimmed version of my code. //file: Serializable.cs
0
3845
by: Mike Grishaber | last post by:
Hello All, I am using an IHttpAsyncHandler class to intercept HTTP Requests and forward them to a system which processes the Request and returns the Result. I use .NET Remoting to connect the IHttpAsyncHandler object to the System and transfer the Request and Result between the two. This works fine for quite a while, and then I start to get the following error. "This remoting proxy has no channel sink which means either the server has
11
11960
by: ajou_king | last post by:
I was running some tests on my Win32 1GHZ processor to see how long it would take to transmit objects numerous times via TCP/IP using C# ..NET Remoting vs the C++ trustworthy method of binary streams. I ran the test for 50K, 100K, 500K iterations, where each iteration consists of sending an object from a client process to a server process, and the server process sends back an ack. Here are the results: .NET Remoting C++...
5
1155
by: Wendy Elizabeth | last post by:
I want a Visual Basic 6.0 web or desk top application to communicate with a Visual Basic.NET web or desktop application. I also want a Visual Basic.NET web or windows application to communicate with Visual Basic 6.0 web or desktop applications. Can you tell me what is the best communication method that should be used and why? Should .NET remoting, using COM objects, or should some other method be used?
13
1923
by: Ron L | last post by:
I am working on an application that is a front-end for a SQL database. While it is not an immediate requirement, the application will probably be required to be able to connect via the internet at a later date, so we are implementing the data connections via remoting. The remoting is implemented via the HTTP channel, with the binary formatter. We have noticed, however, that the remoting calls seemed to be much slower that the OLEDB calls,...
8
1754
by: Raju Joseph | last post by:
Hi All, I am just trying to get an opinion here. I know this is always a tough choice to make. We are in the process of converting our VB6 based Healthcare Information System (a full-fledged package) to .NET. Our clients have been asking for lot of new stuff namely being able to send patient information to devices, being able to fix appointments online, etc.
0
991
by: tomaszh | last post by:
Hello, We are having a problem transfering large amounts of data ( > 3MB) over remoting. The problem only seems to occur when data is transfered from the client to server, as we have successfully transfered ~23MB of data from server to the client using the same method. We are using a DataTable with several columns where one of them is holding a byte array to transfer files. Remoting settings: using WellKnownObjects available via IIS,...
2
1697
by: Ryan | last post by:
My apologies if this is not the forum to post questions regarding .NET Remoting, but I figured WebServices would be the most appropriate forum of the bunch. We're currently completely re-arching some software (currently it's essentially a single tier app - a giant meat ball - we're turning it into an n-tier architecture; gotta love ex-employees). One of the things we're looking at doing is using Remoting from the client to an appserver...
0
9455
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9271
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10031
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9869
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9838
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8709
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6534
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5140
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5302
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.