473,378 Members | 1,134 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

IpcChannel will not create

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?

Dec 20 '07 #1
2 2149
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?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"quilkin" <qu*****@discussions.microsoft.comwrote in message
news:61**********************************@microsof t.com...
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?

Dec 20 '07 #2
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?

"Nicholas Paldino [.NET/C# MVP]" wrote:
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?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"quilkin" <qu*****@discussions.microsoft.comwrote in message
news:61**********************************@microsof t.com...
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?


Dec 20 '07 #3

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

Similar topics

0
by: Mike Chirico | last post by:
Hopefully this will help someone... Helpful Things to Know about MySQL Mike Chirico (mchirico@users.sourceforge.net) Last Updated: Fri Apr 16 11:47:34 EDT 2004 The latest version of this...
2
by: Lonewolf | last post by:
hi all, I realize the example on MSDN for IPCChannel has compile error in VS2005 pro. Either I'm missing something or there's something seriously wrong with MSDN on that section. I reproduce the...
0
by: cody | last post by:
if I create an instance of the IpcChannel class with a normal user account I get a security exception. Is there a way I can avoid this exception?
5
by: Lyle Fairfield | last post by:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/callnetfrcom.asp The Joy of Interoperability Sometimes a revolution in programming forces you to abandon all...
3
by: Grant Schenck | last post by:
I have a simple remoting sample using IPCChannel. If I run the server code as a console app my client can connect just fine. However, if I the same server code runs in a service, the client gets...
1
by: Sparky74 | last post by:
Hi. I have two appications - a GUI and a main engine. The GUI talks to the engine using IPCChannels. If I shutdown the engine, the GUI can still call a method on the interface provided by...
4
by: Alan Mailer | last post by:
Again, I'm new to VB.net and there is something I need help with: Like (I assume) many of us, over time I want to be able to create some VB.net classes that I might want to use in more than one...
0
by: TrevRex | last post by:
Hello, I work for a non-profit in San Diego as a GIS Specialist. I have had to teach myself about some scripting to create some dynamic maps, but I am still very limited in my skills, so I have...
10
by: AAaron123 | last post by:
I want to create a database with one table on the host. I can't user SQL Server Management Studio to do it so I guess I have to do it programmatically. I have in mind that in the session start...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.