473,698 Members | 2,398 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Remoting trouble

Hello all;

I'm having a bit of trouble with .NET remoting. Here's my scenario:

I have a "remotable" type which is served by a Windows Service. I
have a WinForms app which consumes the remotable type. I'm using the
Observer pattern, so the client registers with the server, and the
server refreshes the client as appropriate (doing it this way because
the server polls a device over the serial port, and will update any
registered clients after the poll cycle is complete).

When I start the service, then load the WinForms app, everything works
just fine. However, if I exit the WinForms app, let the service
continue running and then start the WinForms app a second time, I get
the "Server refused connection" exception. If I restart the service,
everything works again.

I assume that there's some kind of remoting clean up I should be
doing, either as the Win app exits, or on the server side as the
Observer unregisters (which I do on dispose of the WinForm)? For what
it's worth, I'm doing all the remoting config programmaticall y.

Thanks for any help,

Derrick

Mar 5 '07 #1
1 1845
On 5 Mar, 15:05, "Derrick" <derrick.sig... @gmail.comwrote :
Hello all;

I'm having a bit of trouble with .NET remoting. Here's my scenario:

I have a "remotable" type which is served by a Windows Service. I
have a WinForms app which consumes the remotable type. I'm using the
Observer pattern, so the client registers with the server, and the
server refreshes the client as appropriate (doing it this way because
the server polls a device over the serial port, and will update any
registered clients after the poll cycle is complete).

When I start the service, then load the WinForms app, everything works
just fine. However, if I exit the WinForms app, let the service
continue running and then start the WinForms app a second time, I get
the "Server refused connection" exception. If I restart the service,
everything works again.

I assume that there's some kind of remoting clean up I should be
doing, either as the Win app exits, or on the server side as the
Observer unregisters (which I do on dispose of the WinForm)? For what
it's worth, I'm doing all the remoting config programmaticall y.

Thanks for any help,

Derrick
I'm not an expert, but I've never had to do anything clever to shut
down my remoting.
Is the error you get:

"No connection could be made because the target machine actively
refused it" ?

If so that means the socket is closed on the server
In my remoting primer which is a very simple forms based server and
client I get that error in the client when the server isn't running.

So you're not doing something silly in the service like relinquishing
the socket? Or for example do you register it on a seperate thread
that ends? Not sure if that would affect it. And are you sure the
service is still running, and not hung or just not reporting that it
shut down?

Where's your ChannelServices .RegisterChanne l(new TcpChannel(5005 0));
or however you're creating your channel?
Mar 5 '07 #2

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

Similar topics

1
1174
by: 0to60 | last post by:
I have an object A, who contains a bunch of maps of other objects B, C, D. Some maps are internal, some are private. Object A inherits from MarshalByRefObject, whereas B, C and D are all marked Serializable. On client computers, I'll obtain a remoting proxy to object A (often proxies to many A's as this is a peer to peer app). Trouble is, if object A's interal maps of B, C and D are large, A's proxies on client computers get large too....
3
1466
by: Skip | last post by:
Hi, I'm new to .NET remoting and there's something I'm having real trouble with. Basically, I'd like to create a component that can act as a server and as a client (can send messages and receive them in asynchronous mode). Here's the situation just so you guys understand why I'm doing this (and maybe so that you can provide me with other options): I have an application that needs to save data to a remote database. The
15
5745
by: Sharon | last post by:
I’m trying to build a generic Publisher-Subscriber that will work over the net, so I’m using the Remoting. I wish that the subscriber user will be notify about the messages sent by the remote publisher, so I used delegate that the user will be able to set on it his own function for that purpuse. The trouble is that this delegate must not be static because there may be many subscribers, and each subscriber may have different...
4
3115
by: Uchiha Jax | last post by:
Hello everyone, I am a plenty silly person who is trying to learn .NET remoting through trial and error (all articles I read are going over my head at the moment (mostly) so I thought i'd give it a go). What I want to do is this: Have a server instance of the program, this server instance will receive communication from client programs (as demonstrated in the AddMessage()
1
1821
by: Bob | last post by:
Let's say I want a program running on one computer to interact in real time with a program running on another computer. With Remoting, I can use a client object to create or connect to a server object and access its methods. But the server object only "responds when asked". I don't see how it could "raise an event" to the client object, thereby facilitating a "two-way" conversation where either object could initiate a process on the...
8
1749
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.
2
3971
by: Lambuz | last post by:
Hi all, I've got this terrible problem. I'm deploying 2 different .NET application (Framework .NET 1.1) that both use remoting technology, but one is a HREF no-touch-deploy smart client and the other one is a .NET control deploy by a tag object. All assemblies are signed with a Strong Name. For the kind of deploy (by IE) and the use of remoting technology I
2
2580
by: TampaWebDevelopment | last post by:
I have built numerous Windows Services over the years, but until this point, I have never needed a GUI to interact with them. Right now, I have a Windows Service that runs FTP backup jobs. I want to build an interface so that the server administrator can add/edit/delete backup jobs. I have come to the conclusion that Remoting is the way to go. I am having trouble finding a good example to achieve my goal. I have seen examples in .NET 1.0...
6
2149
by: John Heitmuller. | last post by:
I have created a very simple and short (70 lines) demo to demonstrate how to send data between instances of the same applications running on the same box. Here is a link to a .zip file that contains the whole project. http://mysite.verizon.net/johnheitmuller/SameBoxChat.zip I have gotten this to work by using the WM_COPYDATA message and calling the SendMessage() function in User32.dll. This satisfies my immediate nee, but I would be...
0
8678
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
8609
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,...
1
8899
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
8871
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
7737
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...
1
6525
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5861
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
4371
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
4621
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.