424,054 Members | 1,055 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,054 IT Pros & Developers. It's quick & easy.

Windows Service takes too long to completely shut down, socket address already used?

P: 1
Hello.
I have a little problem. I created a little Service which uses SIP, all works rather well, but when I want to shut it down in the Services panel, it looks as if it's shut down, but in fact it's not:
- when I try want to delete the .DLL file, I can't: the file is still locked
- if I "Start" my Service again, it refuses
I have to wait like ~20s, and then it is really shut down.

When I shut down the Service, and then try to Start it again, in the Event Viewer it says:
Service cannot be started. System.Net.Sockets.SocketException: Only one usage of each socket address (protocol/network address/port) is normally permitted
at System.Net/Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAdress socketAddress)
at System.Net.Sockets.Bind(EndPoint localEP)
at Microsoft.Rtc.Internal.Sip.TCPListener.Listen(EndP oint endPoint)
etc etc...

Anyway,
- how can I be sure that the sockets I use are "closed" ?
- Where can I put breakpoints in the code to try and see what's still "opened" ? (OnShutdown(), OnExit(), ...) ?

Any tip welcome, thanks.
Mar 6 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.