473,654 Members | 3,082 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Remoting - Detect a crashed/disconnected client from the server?

OK, after lots of faffing I have finally gotten remoting working - basically
I have a windows service (the "server") and a forms app (the "client").

The forms app can call methods in the server, and I can get events fired on
the server to be picked up and acted on in the client app, so all is well. I
can even get two client apps on different machines talking to the same
server instance and the events pop up on both.

This is all good until the "first" client app instance dies unexpectedly
(i.e. for testing, I am just killing it in task manager). The events never
reach the other instance, as the server seems to be sending out the events
synchronously to any connected clients. (I have got some code to unregister
the client/event in the form close event, so if you quit "gracefully " this
problem doesn't occur).

Is there any way of either a) removing a crashed client from the servers
internal list? (I do get an exception in the server when my event is fired,
basically saying the target machine actively refused connection - but what
to do with that info!) or b) can I send out my events from the server in
some async/simultaneous way so it doesn't matter if a client instance has
died or not.

I'd prefer option a as it seems neater, but hey-ho.

TIA

James.

Feb 25 '08 #1
1 3714
James,

When you get the reference to the client, you have an object that
derives from MarshalByRefObj ect. With that, you can call GetLifeTimeServ ice
which will return an object. This object can be cast to an ILease instance
which you would then query to get the state of the connection back to the
client. If the state indicates that it is not connected (or an exception is
thrown), then you can try and unsubscribe through the ILease interface, and
proceed from there.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"JamesB" <ja****@somewhe re.com.net.com. netwrote in message
news:47******** **************@ news.zen.co.uk. ..
OK, after lots of faffing I have finally gotten remoting working -
basically I have a windows service (the "server") and a forms app (the
"client").

The forms app can call methods in the server, and I can get events fired
on the server to be picked up and acted on in the client app, so all is
well. I can even get two client apps on different machines talking to the
same server instance and the events pop up on both.

This is all good until the "first" client app instance dies unexpectedly
(i.e. for testing, I am just killing it in task manager). The events never
reach the other instance, as the server seems to be sending out the events
synchronously to any connected clients. (I have got some code to
unregister the client/event in the form close event, so if you quit
"gracefully " this problem doesn't occur).

Is there any way of either a) removing a crashed client from the servers
internal list? (I do get an exception in the server when my event is
fired, basically saying the target machine actively refused connection -
but what to do with that info!) or b) can I send out my events from the
server in some async/simultaneous way so it doesn't matter if a client
instance has died or not.

I'd prefer option a as it seems neater, but hey-ho.

TIA

James.

Feb 25 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1901
by: bettervssremoting | last post by:
To view the full article, please visit http://www.BetterVssRemoting.com Better VSS Remote Access Tool This article makes a detailed comparison among SourceAnyWhere, SourceOffSite, VSS Remoting and possible others. Keywords: VSS Remote Access, VSS Web Access, VSS Internet Access,
5
5677
by: mayamorning123 | last post by:
A comparison among six VSS remote tools including SourceOffSite , SourceAnyWhere, VSS Connect, SourceXT, VSS Remoting, VSS.NET To view the full article, please visit http://www.BetterVssRemoting.com Better VSS Remote Access Tool This article makes a detailed comparison among SourceAnyWhere 4.0, SourceOffSite 4.1, VSS Connect 1.5, SourceXT 2.1, VSS Remoting 2.5,
0
3282
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.
0
953
by: Nadav | last post by:
Hi, Introduction: ******************** I am using remoting to expose the control channels of my streaming server, I need to be able to detect when a certain client was terminated, this should be done ONLY from the server side. My server expose the IServer interface what contain a single CreateSession method, calling this method returns ( through remoting ) a session interface
0
1418
by: bettervssremoting | last post by:
To view the full article, please visit http://www.BetterVssRemoting.com Better VSS Remote Access Tool This article makes a detailed comparison among SourceAnyWhere, SourceOffSite, VSS Remoting and possible others. Keywords: VSS Remote Access, VSS Web Access, VSS Internet Access,
1
5376
by: Roy | last post by:
Hi, I have a problem that I have been working with for a while. I need to be able from server side (asp.net) to detect that the file i'm streaming down to the client is saved completely/succsessfully on the client's computer before updating some metadata on the server (file downloaded date for instance) However, All examples i have tried, and all examples I have found that other people says works - doesn't work for me :-(
3
4267
by: Szafranr | last post by:
Hi I have application where I used tcpListener to connect with another system. Every thing is ok that it's time to error handling and I have problem when the TCP client is disconect I don't know how detect this situation the same situation is when I plug out patch-cord For waiting for a data I use this loop While Me.mSocket.Connected
3
2314
by: Michael Maes | last post by:
Hi, We have a windows service passing objects to a client application by remoting. The windows service is started and running successfully. * When the client app is running on the same machine as the windows service (W2K3) every method gets executed successfully. * When the client app is running on a different machine (XP SP2), some methods from the remote object the client calls make client hang. Other
0
1260
by: =?Utf-8?B?Sm9obiBXLg==?= | last post by:
A client application connects to a TCP-remoted object from a service on localhost for method invocations and events. It works as advertised. But... if the network cable (LAN) gets disconnected, the event subscriptions to the localhost server are lost because "The connection was forcibly closed...". If the remoting proxy had also gone away, the client would detect it and begin trying to re-establish the connection. But it doesn't; the...
0
8706
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
8475
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
8591
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7304
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
4149
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
4293
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2709
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1915
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1592
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.