[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

microsoft.public.dotnet.framework.remoting

server calls client, client calls server problem.

Willie wjb

6/24/2004 7:32:00 AM

Hi,

CURRENT PROJECT
I have created a Client Server program where the Client builds up a
connection to the Server and sends data to it that has to be stored in a
database.

WHAT DO I WANT
But for some reason i want the server to check the clients in a interval
period.

QUESTIONS.
If i want such a mechanism is this possible through callbacks, or is a
callback just for starting a function on the server from the client and when
finised, receive the answer?

Or should is use Events?

My main brainwave is what happens when the network for some reason dies for
some time, and i have created a connection to the server where i say this is
the (callback)address you must use to reach the Client. The Server loses its
connection, but it is possible that the Client does not know that the server
lost the address.

For the future i have to take into account that the Server is not capable of
calling the clients itself, bu the Clients have to make the first
connection.

Thanks for any advice,

Willie



6 Answers

Sunny

6/24/2004 2:51:00 PM

0

Hi,

In article <uImoI0bWEHA.3512@TK2MSFTNGP12.phx.gbl>, wjbons@nomail.nl
says...
> Hi,
>
> CURRENT PROJECT
> I have created a Client Server program where the Client builds up a
> connection to the Server and sends data to it that has to be stored in a
> database.
>
> WHAT DO I WANT
> But for some reason i want the server to check the clients in a interval
> period.
>
> QUESTIONS.
> If i want such a mechanism is this possible through callbacks, or is a
> callback just for starting a function on the server from the client and when
> finised, receive the answer?
>
> Or should is use Events?
>
> My main brainwave is what happens when the network for some reason dies for
> some time, and i have created a connection to the server where i say this is
> the (callback)address you must use to reach the Client. The Server loses its
> connection, but it is possible that the Client does not know that the server
> lost the address.
>
> For the future i have to take into account that the Server is not capable of
> calling the clients itself, bu the Clients have to make the first
> connection.
>
> Thanks for any advice,
>
> Willie
>

it depends on what kind of remote object you will focus. If this is CAO,
then a client side sponsor will help you, as when the lifetime of the
object expires, the server will try to contact the client to renew the
object, and if this fails, the server will know that client is not
available.

Also, you may check the second implementation here:
http://www.genuinechannels.com/Content.aspx?id=27&...

It uses events, so you have to start a timer at the server, which at
regular intervals tries to "ping" the clients.

You have to be aware that with the build-in channels in the framework,
you may have problems with the callbacks (it includes direct method
calls, events, client side sponsors), if your clients are behind
firewalls/proxies, as most of the corporate firewalls will not allow you
to dedicate a given port for a single client, nor are going to forward
such a calls.

The you have 2 options:
1. Do not use callbacks. Start a thread at the client which "pings" the
server at regular intervals.
2. Use some bidirectional channels like genuine channels (this is paid,
but not expensive solution).

Hope that helps
Sunny

Allen Anderson

6/24/2004 3:02:00 PM

0

yes, use events to notify back to the clients. The server can
initiate these events if you desire. Now that can happen one of a
couple ways. If you have a singleton that has threads running, it can
make callbacks on its own, or you can have an administrative process
that knows when callbacks are needed and make appropriate calls onto
the object which them calls back to all subscribers to the event.

As for client dying, you need to setup a server side sponsor to be
able to collect the object when it goes away.

Allen Anderson
http://www.glacialcomp...
mailto: allen@put my website url here.com


On Thu, 24 Jun 2004 09:32:05 +0200, "Willie wjb" <wjbons@nomail.nl>
wrote:

>Hi,
>
>CURRENT PROJECT
>I have created a Client Server program where the Client builds up a
>connection to the Server and sends data to it that has to be stored in a
>database.
>
>WHAT DO I WANT
>But for some reason i want the server to check the clients in a interval
>period.
>
>QUESTIONS.
>If i want such a mechanism is this possible through callbacks, or is a
>callback just for starting a function on the server from the client and when
>finised, receive the answer?
>
>Or should is use Events?
>
>My main brainwave is what happens when the network for some reason dies for
>some time, and i have created a connection to the server where i say this is
>the (callback)address you must use to reach the Client. The Server loses its
>connection, but it is possible that the Client does not know that the server
>lost the address.
>
>For the future i have to take into account that the Server is not capable of
>calling the clients itself, bu the Clients have to make the first
>connection.
>
>Thanks for any advice,
>
>Willie
>
>

Willie wjb

6/25/2004 7:42:00 AM

0

mm, so even with callbacks i could have problems with firewalls, didn''t know
that...

Pinging from the client at the server where a action queue is located where
it can have a look to do something is an option, but in my case there will
be a GUI application connected to the server which will ask for client
status. For example get the harddisk free space.

So this would mean that calling from the GUI would imply a waiting cycle for
the first time the client will poll, get the action perform it and send the
result to the server.

The benefit would be that when information from let''s say 100 clients is
needed, this is asynchroon collected, which should be faster than
sequential....


"Sunny" <sunnyask@icebergwireless.com> wrote in message
news:OiwR7qfWEHA.1888@TK2MSFTNGP11.phx.gbl...
> Hi,
>
> In article <uImoI0bWEHA.3512@TK2MSFTNGP12.phx.gbl>, wjbons@nomail.nl
> says...
> > Hi,
> >
> > CURRENT PROJECT
> > I have created a Client Server program where the Client builds up a
> > connection to the Server and sends data to it that has to be stored in a
> > database.
> >
> > WHAT DO I WANT
> > But for some reason i want the server to check the clients in a interval
> > period.
> >
> > QUESTIONS.
> > If i want such a mechanism is this possible through callbacks, or is a
> > callback just for starting a function on the server from the client and
when
> > finised, receive the answer?
> >
> > Or should is use Events?
> >
> > My main brainwave is what happens when the network for some reason dies
for
> > some time, and i have created a connection to the server where i say
this is
> > the (callback)address you must use to reach the Client. The Server loses
its
> > connection, but it is possible that the Client does not know that the
server
> > lost the address.
> >
> > For the future i have to take into account that the Server is not
capable of
> > calling the clients itself, bu the Clients have to make the first
> > connection.
> >
> > Thanks for any advice,
> >
> > Willie
> >
>
> it depends on what kind of remote object you will focus. If this is CAO,
> then a client side sponsor will help you, as when the lifetime of the
> object expires, the server will try to contact the client to renew the
> object, and if this fails, the server will know that client is not
> available.
>
> Also, you may check the second implementation here:
> http://www.genuinechannels.com/Content.aspx?id=27&...
>
> It uses events, so you have to start a timer at the server, which at
> regular intervals tries to "ping" the clients.
>
> You have to be aware that with the build-in channels in the framework,
> you may have problems with the callbacks (it includes direct method
> calls, events, client side sponsors), if your clients are behind
> firewalls/proxies, as most of the corporate firewalls will not allow you
> to dedicate a given port for a single client, nor are going to forward
> such a calls.
>
> The you have 2 options:
> 1. Do not use callbacks. Start a thread at the client which "pings" the
> server at regular intervals.
> 2. Use some bidirectional channels like genuine channels (this is paid,
> but not expensive solution).
>
> Hope that helps
> Sunny


Willie wjb

6/25/2004 7:46:00 AM

0

i have a singlecall class where the clients connect to.
Would this become a problem for events?

I could create a local Server class where needed connection info is saved
for event purposes but could i raise an event to an client from such an
saved item?

"Allen Anderson" <allen@sparkysystems.com> wrote in message
news:64rld0dq9smef5vf8r1v6lrjp987sulmm3@4ax.com...
> yes, use events to notify back to the clients. The server can
> initiate these events if you desire. Now that can happen one of a
> couple ways. If you have a singleton that has threads running, it can
> make callbacks on its own, or you can have an administrative process
> that knows when callbacks are needed and make appropriate calls onto
> the object which them calls back to all subscribers to the event.
>
> As for client dying, you need to setup a server side sponsor to be
> able to collect the object when it goes away.
>
> Allen Anderson
> http://www.glacialcomp...
> mailto: allen@put my website url here.com
>
>
> On Thu, 24 Jun 2004 09:32:05 +0200, "Willie wjb" <wjbons@nomail.nl>
> wrote:
>
> >Hi,
> >
> >CURRENT PROJECT
> >I have created a Client Server program where the Client builds up a
> >connection to the Server and sends data to it that has to be stored in a
> >database.
> >
> >WHAT DO I WANT
> >But for some reason i want the server to check the clients in a interval
> >period.
> >
> >QUESTIONS.
> >If i want such a mechanism is this possible through callbacks, or is a
> >callback just for starting a function on the server from the client and
when
> >finised, receive the answer?
> >
> >Or should is use Events?
> >
> >My main brainwave is what happens when the network for some reason dies
for
> >some time, and i have created a connection to the server where i say this
is
> >the (callback)address you must use to reach the Client. The Server loses
its
> >connection, but it is possible that the Client does not know that the
server
> >lost the address.
> >
> >For the future i have to take into account that the Server is not capable
of
> >calling the clients itself, bu the Clients have to make the first
> >connection.
> >
> >Thanks for any advice,
> >
> >Willie
> >
> >
>


Allen Anderson

6/25/2004 2:55:00 PM

0

you can''t attach events to a singlecall server. Even though it lets
you, its not really attaching them since singlecall objects hold no
state. Hence an ''event'' object on a singlecall object would get
cleared every time.

you need to create a CAO or SAO Singleton to get events to come back
to you.

Allen Anderson
http://www.glacialcomp...
mailto: allen@put my website url here.com

On Fri, 25 Jun 2004 09:46:14 +0200, "Willie wjb" <wjbons@nomail.nl>
wrote:

>i have a singlecall class where the clients connect to.
>Would this become a problem for events?
>
>I could create a local Server class where needed connection info is saved
>for event purposes but could i raise an event to an client from such an
>saved item?
>

Sunny

6/28/2004 2:27:00 PM

0

So, as I said, if you are going for internet scenario with
proxies/firewalls and you need callbacks, the you have to go with third
party channels.

Sunny

In article <OBqvLeoWEHA.3492@TK2MSFTNGP10.phx.gbl>, wjbons@nomail.nl
says...
> mm, so even with callbacks i could have problems with firewalls, didn''t know
> that...
>
> Pinging from the client at the server where a action queue is located where
> it can have a look to do something is an option, but in my case there will
> be a GUI application connected to the server which will ask for client
> status. For example get the harddisk free space.
>
> So this would mean that calling from the GUI would imply a waiting cycle for
> the first time the client will poll, get the action perform it and send the
> result to the server.
>
> The benefit would be that when information from let''s say 100 clients is
> needed, this is asynchroon collected, which should be faster than
> sequential....
>
>
> "Sunny" <sunnyask@icebergwireless.com> wrote in message
> news:OiwR7qfWEHA.1888@TK2MSFTNGP11.phx.gbl...
> > Hi,
> >
> > In article <uImoI0bWEHA.3512@TK2MSFTNGP12.phx.gbl>, wjbons@nomail.nl
> > says...
> > > Hi,
> > >
> > > CURRENT PROJECT
> > > I have created a Client Server program where the Client builds up a
> > > connection to the Server and sends data to it that has to be stored in a
> > > database.
> > >
> > > WHAT DO I WANT
> > > But for some reason i want the server to check the clients in a interval
> > > period.
> > >
> > > QUESTIONS.
> > > If i want such a mechanism is this possible through callbacks, or is a
> > > callback just for starting a function on the server from the client and
> when
> > > finised, receive the answer?
> > >
> > > Or should is use Events?
> > >
> > > My main brainwave is what happens when the network for some reason dies
> for
> > > some time, and i have created a connection to the server where i say
> this is
> > > the (callback)address you must use to reach the Client. The Server loses
> its
> > > connection, but it is possible that the Client does not know that the
> server
> > > lost the address.
> > >
> > > For the future i have to take into account that the Server is not
> capable of
> > > calling the clients itself, bu the Clients have to make the first
> > > connection.
> > >
> > > Thanks for any advice,
> > >
> > > Willie
> > >
> >
> > it depends on what kind of remote object you will focus. If this is CAO,
> > then a client side sponsor will help you, as when the lifetime of the
> > object expires, the server will try to contact the client to renew the
> > object, and if this fails, the server will know that client is not
> > available.
> >
> > Also, you may check the second implementation here:
> > http://www.genuinechannels.com/Content.aspx?id=27&...
> >
> > It uses events, so you have to start a timer at the server, which at
> > regular intervals tries to "ping" the clients.
> >
> > You have to be aware that with the build-in channels in the framework,
> > you may have problems with the callbacks (it includes direct method
> > calls, events, client side sponsors), if your clients are behind
> > firewalls/proxies, as most of the corporate firewalls will not allow you
> > to dedicate a given port for a single client, nor are going to forward
> > such a calls.
> >
> > The you have 2 options:
> > 1. Do not use callbacks. Start a thread at the client which "pings" the
> > server at regular intervals.
> > 2. Use some bidirectional channels like genuine channels (this is paid,
> > but not expensive solution).
> >
> > Hope that helps
> > Sunny
>
>
>