[RESOLVED] Socket/Port remains open after app crashes


Posted on 16th Feb 2014 07:03 pm by admin

I'm having this problem with a networked app in vb.net.

If the program exits normally the port closes fine, however, if it crashes sometimes it remains open and I am unable to close it. The next time I run the program it is unable to open the port because it is already in use. Here's the exception:
10048: Only one usage of each socket address (protocol/network address/port) is normally permittedAny ideas on how I can reclaim this port, or how I can close it?
I tried using the reuse address socket option

Code: SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, 1) but that just opens the port again and does not close the old one. see this netstat output:

TCP PCISERVER:14000 PCISERVER.cpwpci.cpwgroup.net:0 LISTENING 4320
[System]

TCP PCISERVER:14000 PCISERVER.cpwpci.cpwgroup.net:0 LISTENING 5808
[System]

TCP PCISERVER:14001 PCISERVER.cpwpci.cpwgroup.net:0 LISTENING 5808
[System]

TCP PCISERVER:14001 PCISERVER.cpwpci.cpwgroup.net:0 LISTENING 4320
[System]

As you can see once the program exits the ports remain opened by the System process.
I don't know of a way to stop them from listening besides a restart.

No comments posted yet

Your Answer:

Login to answer
87 Like 27 Dislike
Previous forums Next forums
Other forums

Call to undefined function mysql_fetch_accoc()
New to php/mysql coding. What's wrong with this sequence, or am I
just not seeing to obvious?

storing video files into mysql in php
hi

i have my video files in my folder ,
i have to store the path of the videos into db an

Login Control?!
I have a Web Site that uses the login control also I have set the destinationurl to the page I want

php or sql?
Sorry not sure if this is a sql problem or php the following code is supposed to delete data from th

This must be easy , pulling the last record of the day, every day, from a txt
I have a txt file logging weather data every minutes (so 1 record per minute). I want to extract the

Not loading image
When this function gets loaded it doesn't load the image just trying to figure out why.

Code:

Scene graph using Direct3D?
There are several C++ scene graph based packages available for OpenGl, like say OSG,

http://w

Help with PHP and checkboxes
I am posting this for a friend of mine, i wrote a small script for her to process her form data to a

if php cookie set, show code...
Hi all.. I need to figure out this little snippet right quick.. seems like it should be easy enough

Warning: session_start() [function.session-start]: Cann.....
hi, can someone help me with this? I keep getting this error....

Warning: session_start() [fu

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash