[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

include function being weird?
I have a very simple system to grab an IP outputted by a PHP file.. (for a project I have) but it ou

modifying a property of an object from a different class
I have 2 classes:
- Math
- Distance

in my math class, I have this line:
$distance =

Target costs on Process orders not calculating
Hi All,

We have released standard costs for all the materials. We have also done Goods r

Display search result
Hi!

I have a SQL database with information about albums and track (music).

This is wh

Change image filetype on upload?
Hi,
I've got a form which uploads an image to the server.
Is it possible to change the image t

what are '%S%', '%E%'
for example when i see Code: [Select]printf("Hello %srn", $name);
what does %s means

Something like an INI editor or a DelimitedText-Editor
Hi all,

Am very, very, very new to PHP and not sure if I should be posting this to a Javascri

Passing vars to the DB
I have 3 small testing tables:

ID TYPE
1 pepperoni
2 C. bacon
3 taco

ID TY

help me, how to find text on an external html site using PHP
Would anyone know how to search an external html file for a work or phrase ?

I was thinking s

Install page
How do I make it so when a user submits information on the Install page, it'll right it into the cor

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