[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

microsoft.public.dotnet.framework.remoting

Give Client Reference to a Server Object

msnews.microsoft.com

7/9/2004 11:26:00 PM

I'm trying to construct a client application with two components.

Component 1 - A C# service that synchronizes data from a remote data
source.
Component 2 - A C# windows forms application.

Both component 1 and component 2 will be running on the same computer.
Component 1 is expected to always we running. (never more than 1
instance)
Component 2 is expected to be running sometimes. (never more than 1
instance)

When Component 2 is not online I'd like data sent to MSDE (that's easy)
When Component 2 starts I'd like to stop sending data to MSDE and start
sending data to Component 2. (not so sure)

I was of the mind that I could use .net remoting to handle this.

I was hoping to raise events from component 1 when new data needed
arrived, hence my question.

How do create the initial reference of the RemoteObject in Component 1
and hand that reference to the client so the client can trap new data events
raised from component 1?

Frank Gibbs
Norac, Inc.
Senior Programmer
frankg@dev.norac.com






12 Answers

Sunny

7/12/2004 6:03:00 PM

0

Hi,

In article <#X4XkwgZEHA.2260@TK2MSFTNGP12.phx.gbl>, frankg@norac.com
says...
> I''m trying to construct a client application with two components.
>
> Component 1 - A C# service that synchronizes data from a remote data
> source.
> Component 2 - A C# windows forms application.
>
> Both component 1 and component 2 will be running on the same computer.
> Component 1 is expected to always we running. (never more than 1
> instance)
> Component 2 is expected to be running sometimes. (never more than 1
> instance)
>
> When Component 2 is not online I''d like data sent to MSDE (that''s easy)
> When Component 2 starts I''d like to stop sending data to MSDE and start
> sending data to Component 2. (not so sure)
>
> I was of the mind that I could use .net remoting to handle this.
>
> I was hoping to raise events from component 1 when new data needed
> arrived, hence my question.
>
> How do create the initial reference of the RemoteObject in Component 1
> and hand that reference to the client so the client can trap new data events
> raised from component 1?

Create your server object as static, and then use
RemotingServices.Marshal to expose it to remoting.


Sunny

msnews.microsoft.com

7/12/2004 8:55:00 PM

0

Code my server object as static or instantiate my server object as static?



"Sunny" <sunny@newsgroups.nospam> wrote in message
news:eM0RJqDaEHA.2844@TK2MSFTNGP12.phx.gbl...
> Hi,
>
> In article <#X4XkwgZEHA.2260@TK2MSFTNGP12.phx.gbl>, frankg@norac.com
> says...
> > I''m trying to construct a client application with two components.
> >
> > Component 1 - A C# service that synchronizes data from a remote data
> > source.
> > Component 2 - A C# windows forms application.
> >
> > Both component 1 and component 2 will be running on the same
computer.
> > Component 1 is expected to always we running. (never more than 1
> > instance)
> > Component 2 is expected to be running sometimes. (never more than 1
> > instance)
> >
> > When Component 2 is not online I''d like data sent to MSDE (that''s
easy)
> > When Component 2 starts I''d like to stop sending data to MSDE and
start
> > sending data to Component 2. (not so sure)
> >
> > I was of the mind that I could use .net remoting to handle this.
> >
> > I was hoping to raise events from component 1 when new data needed
> > arrived, hence my question.
> >
> > How do create the initial reference of the RemoteObject in Component
1
> > and hand that reference to the client so the client can trap new data
events
> > raised from component 1?
>
> Create your server object as static, and then use
> RemotingServices.Marshal to expose it to remoting.
>
>
> Sunny


msnews.microsoft.com

7/12/2004 9:02:00 PM

0

ahhh, like this

SampleWellKnown objectWellKnown = new SampleWellKnown();

// After the channel is registered, the object needs to be registered
// with the remoting infrastructure. So, Marshal is called.
ObjRef objrefWellKnown = RemotingServices.Marshal(objectWellKnown,
"objectWellKnownUri");




"msnews.microsoft.com" <frankg@norac.com> wrote in message
news:u7ttQKFaEHA.2016@TK2MSFTNGP09.phx.gbl...
> Code my server object as static or instantiate my server object as static?
>
>
>
> "Sunny" <sunny@newsgroups.nospam> wrote in message
> news:eM0RJqDaEHA.2844@TK2MSFTNGP12.phx.gbl...
> > Hi,
> >
> > In article <#X4XkwgZEHA.2260@TK2MSFTNGP12.phx.gbl>, frankg@norac.com
> > says...
> > > I''m trying to construct a client application with two components.
> > >
> > > Component 1 - A C# service that synchronizes data from a remote
data
> > > source.
> > > Component 2 - A C# windows forms application.
> > >
> > > Both component 1 and component 2 will be running on the same
> computer.
> > > Component 1 is expected to always we running. (never more than 1
> > > instance)
> > > Component 2 is expected to be running sometimes. (never more than
1
> > > instance)
> > >
> > > When Component 2 is not online I''d like data sent to MSDE (that''s
> easy)
> > > When Component 2 starts I''d like to stop sending data to MSDE and
> start
> > > sending data to Component 2. (not so sure)
> > >
> > > I was of the mind that I could use .net remoting to handle this.
> > >
> > > I was hoping to raise events from component 1 when new data needed
> > > arrived, hence my question.
> > >
> > > How do create the initial reference of the RemoteObject in
Component
> 1
> > > and hand that reference to the client so the client can trap new data
> events
> > > raised from component 1?
> >
> > Create your server object as static, and then use
> > RemotingServices.Marshal to expose it to remoting.
> >
> >
> > Sunny
>
>


Sunny

7/12/2004 10:15:00 PM

0

Yes :)

Sunny

In article <#WV0NOFaEHA.2520@TK2MSFTNGP12.phx.gbl>, frankg@norac.com
says...
> ahhh, like this
>
> SampleWellKnown objectWellKnown = new SampleWellKnown();
>
> // After the channel is registered, the object needs to be registered
> // with the remoting infrastructure. So, Marshal is called.
> ObjRef objrefWellKnown = RemotingServices.Marshal(objectWellKnown,
> "objectWellKnownUri");
>
>
>
>
> "msnews.microsoft.com" <frankg@norac.com> wrote in message
> news:u7ttQKFaEHA.2016@TK2MSFTNGP09.phx.gbl...
> > Code my server object as static or instantiate my server object as static?
> >
> >
> >
> > "Sunny" <sunny@newsgroups.nospam> wrote in message
> > news:eM0RJqDaEHA.2844@TK2MSFTNGP12.phx.gbl...
> > > Hi,
> > >
> > > In article <#X4XkwgZEHA.2260@TK2MSFTNGP12.phx.gbl>, frankg@norac.com
> > > says...
> > > > I''m trying to construct a client application with two components.
> > > >
> > > > Component 1 - A C# service that synchronizes data from a remote
> data
> > > > source.
> > > > Component 2 - A C# windows forms application.
> > > >
> > > > Both component 1 and component 2 will be running on the same
> > computer.
> > > > Component 1 is expected to always we running. (never more than 1
> > > > instance)
> > > > Component 2 is expected to be running sometimes. (never more than
> 1
> > > > instance)
> > > >
> > > > When Component 2 is not online I''d like data sent to MSDE (that''s
> > easy)
> > > > When Component 2 starts I''d like to stop sending data to MSDE and
> > start
> > > > sending data to Component 2. (not so sure)
> > > >
> > > > I was of the mind that I could use .net remoting to handle this.
> > > >
> > > > I was hoping to raise events from component 1 when new data needed
> > > > arrived, hence my question.
> > > >
> > > > How do create the initial reference of the RemoteObject in
> Component
> > 1
> > > > and hand that reference to the client so the client can trap new data
> > events
> > > > raised from component 1?
> > >
> > > Create your server object as static, and then use
> > > RemotingServices.Marshal to expose it to remoting.
> > >
> > >
> > > Sunny
> >
> >
>
>
>

UsurperTom

10/16/2009 11:22:00 PM

0

On Oct 16, 7:11?pm, "RichL" <rpleav...@yahoo.com> wrote:

> Such as?

Ripping off John's relatives is one thing. I won't go into detail
because I have a lot of inside information.

BLACKPOOLJIMMY

10/16/2009 11:29:00 PM

0

On Oct 16, 7:22?pm, UsurperTom <Usurper...@aol.com> wrote:
> On Oct 16, 7:11 pm, "RichL" <rpleav...@yahoo.com> wrote:
>
> > Such as?
>
> Ripping off John's relatives is one thing. I won't go into detail
> because I have a lot of inside information.

But sources could make your position more acceptable. If there is an
understanding to not "spill the beans"..that's fine. However your
statements then become your statements and nothing more.

The Walrus was Danny

10/17/2009 12:53:00 AM

0


> YT #1 Fattuchus/Cancer
> YT #2 F Parella
> YT #3 lovely you

Joy!! I've been promoted!!

Thanks Guru!

Never been in the lofty heights of Thunderbird 3! Always my favourute
thunderbird!!

Danny

The Walrus was Danny

10/17/2009 12:56:00 AM

0

At least,
> now that Francie is long gone.

I reckon Franks has fallen in love. Her YO has taken her away.

Danny

The Walrus was Danny

10/17/2009 12:58:00 AM

0


> Do you know the people who were allegedly ripped off?

Tom has mates I do believe...

Danny

Dale Houstman

10/17/2009 1:51:00 AM

0

BLACKPOOLJIMMY wrote:
> On Oct 16, 4:46???pm, Dale Houstman <d...@skypoint.com> wrote:
>> BLACKPOOLJIMMY wrote:
>>> On Oct 16, 3:40 pm, poisoned rose <prose1...@aol.com> wrote:
>>>> The Walrus was Danny <dannyisthewal...@tesco.net> wrote:
>>>>> and his opinions are similar to the
>>>>>> other so called Yoko Tards. He just writes fancier.
>>>>> Actually since Guru has now returned I wonder if us YTs have been
>>>>> redesignated...I think I was YT number 4..Guru?
>>>>> Danny
>>>> Well, BPJimmy was kicked out of the clan for behaving too much like a
>>>> human being.
>>> My turnaround came about after some thoughts about WHY the Yoko slams
>>> (on my part). How silly it was to think I could rationlize or pretend
>>> to be in John's head. I do not like Yoko's art, music... so, I also
>>> don't like some of Lennon's. ???I finally understood. To John, Yoko
>>> herself, ???WAS the art. Finally a person he could give the finger to
>>> the world with. For Lennon's sake..I'm glad he found a Yoko before his
>>> short life was snuffed out.
>>> The Beatles just weren't enough for the man.
>>> In my opinion, we all could use a Yoko (if we don't already have one).
>> I must say that your analysis of the relationship is one that occurred
>> also to me, and is (as always) partly borne out by what we saw. But...I
>> am not so enamored (or at least convinced) of the conclusion: that
>> John's choice was necessarily an entirely healthy one, or that we would
>> all be better off making a similar one.
>
> Agree. John's choices with (I think) most things in his life, be it
> drugs, drink, womanizing were unhealthy. Yoko just seemed too fit all
> that he was about. When I say we could all use a Yoko..It was only in
> the context of finding a soulmate and making ones life whole. Of
> course that could mean healthy or unhealthy. Then again, some do get
> along perfectly well, alone.

There's a little bit of miasma in there: "making one's life whole" is -
I gather - usually reserved for exactly what are construed as healthy
relationships. Whole foods, wholesome, etc. Although I grasp what you're
getting at there, I think it doesn't quite work. And I am not perfectly
clear on the idea of YO's "fitting all he was about", or - if she did -
how that can be understood in terms of quality. If all you are saying is
"John and Yoko got together and although it was another unhealthy choice
for John, it made him complete in some indefinable manner" I suppose I
couldn't argue, but I'm not sure I could estimate its import either.
>
> I think - if I take you
>> correctly - that choosing a mate based at least in small part on the
>> fact that you know it will be an affront to the world about you (by
>> shocking or by dispelling some myths you have grown tired of), is
>> frankly not a healthy way to find love.
>
> Agree again but think John was searching all his life for some kind of
> meaning.. and finding Yoko and not having to stand alone was what the
> doctor ordered, for him.

We're all searching for meaning, or at least meaning to search. But you
initially spun this crusade in terms of YO being another way to give the
bird to the world. I suppose that constitutes a meaning, but the
question about its health still remains. Not that unhealthy
relationships are such rara aves (more birds!). I imagine almost any
relationship John might have stumbled across at this moment in his life
had the potential to be unhealthy in some way or another. It still
depresses me (from an aesthetic viewpoint) that John was so impressed by
YO's art at the time: the climb up the ladder, the little "Yes," the
hammer and nails, etc. It still strikes me as awfully puerile modernisn.
But perhaps John's artistic temperament was not so well formed. I don't
know.

> Being a Beatle might have made most anyone
> else fullfiled in life but he needed more. I really don't think John
> was happy for most his days, Yoko brought what he might have thought
> (and said) "finally".

But WAs he then happy - however that is defined? He said so, so I
suppose so, but to my eyes (even "back then") his public appearances and
Yoko-derived happenings seemed forced, and if one can judge a musician's
"happiness" by the quality of their work, I think the spotty solo
recordings seem to lack vitality, drive, and so on.
>
> John and Yoko (if we accept your
>> premise for the nonce) are certainly not the first or last to "couple"
>> based on such misanthropic motives, but - at the very least - I am glad
>> that that is not why I - or any of my friends - got "hitched".
>
> But maybe, just maybe if you were Beatle John, your reasons for
> marriage to a woman like Yoko, would have been from a different point
> of view.

And if I were a yak, I'd wear a different hat...But that's beside the
point finally. Of course if I were Beatle John, I would have Beatle
John's motivations, desires, issues... But that is not a productive
process in analyzing a situation, in qualifying it. It makes no
difference now or then what I think about it of course, and that's
butter under the balls. I don't want to hallucinate that I am John, but
to try and comprehend (from a necessary outside position) what it might
mean: if I were overly concerned.
>
> Glad yours is good and healthy.

Well, my wife might hold a different opinion...

dmh