S
Sunny
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
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