[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

SQL Query/echo not working
Hey all,

I'm trying to run (what I thought) was a simple operation and it isn't working. I h

check comment for html
hi, I just wanted to check if a comment a user posts contains HTML, and if it does, to not allow it

 formating when pulling data from a mysql database 
Ok so Im not to sure if this is the right thread to post in but here is my catch 22 issue.

I

Why do I get this error?
Error:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or

php mysql script to find record
Hi,

Currently I have a simple table with 4 columns. A, B, C, D

If I want to find all

Sorting JTable on more than just the values listed in the columns
I have a collection of objects that store (among other things) two integer values. I only want to di

CHECH A STRING FOR ' " ' (DOUBLE QUOTES)
I am checking for delimiter (.!?) and if there is a " after a sentence then it should neglect a

Floating Point Precision Loss
I'm writing a program to draw a three-dimensional cube (with a corner cut off) without using any 3D

Using two $_POST Function / Switch () statements, second does not work.
Hi all. I’m new to php and am having a problem getting $_POST Function / switch () to work. I

How to pass parameter to tag query?
Hi,
I want to get the value of a tag at a specific time (like 10/27/09 15:29:59), I need to giv

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