Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / December 2007

Tip: Looking for answers? Try searching our database.

IpcChannel will not create

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
quilkin - 20 Dec 2007 09:52 GMT
Hi,
I have a Windows service which communicates to a user app via IpcChannel
remoting.
It all works fine until the service is stopped and restarted (or restarted
via Management Console Services), when the lines
                   _ipc = new IpcChannel(properties, clientProv, serverProv);
                   ChannelServices.RegisterChannel(_ipc, true);
fail because _ipc returns 'null'.
I did try have a statement
               ChannelServices.UnregisterChannel(_ipc);
when the service stops but that made no difference.
If I wait several minutes before restarting the service, it usually restarts
OK, but I need it to restart in less than one minute if there's a problem
with it. Note,  it always restarts OK on Vista, this problem is only evident
on XP!!

So, how do ensure that the previous incarnation of the remoting channel is
always deleted?
Nicholas Paldino [.NET/C# MVP] - 20 Dec 2007 15:55 GMT
Well, this kind of indicates that you are not keeping track of the
channel in your service like you should.  There should only be some very
limited places where you would need to create/destroy the channel, are you
sure you are doing it in the appropriate places?

Signature

         - Nicholas Paldino [.NET/C# MVP]
         - mvp@spam.guard.caspershouse.com

> Hi,
> I have a Windows service which communicates to a user app via IpcChannel
[quoted text clipped - 17 lines]
> So, how do ensure that the previous incarnation of the remoting channel is
> always deleted?
quilkin - 20 Dec 2007 17:03 GMT
Nicholas,

The channel is created once, and once only, in the 'OnStart()' method of the
service. _ipc is currently a class property but  we have also tried it as  a
local in the constructor so it should have got destroyed there.
Can't use the 'using' statement because IpcChannel is not 'disposable'.
Presumably something in XP is doing a cleanup several minutes after the
service closes. But in Vista it's cleaned straight away. is this a clue?

>     Well, this kind of indicates that you are not keeping track of the
> channel in your service like you should.  There should only be some very
[quoted text clipped - 22 lines]
> > So, how do ensure that the previous incarnation of the remoting channel is
> > always deleted?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.