[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

upload only text files
hi guys i want to upload only text like like (pdf,note pad and ofiice files) so can any one please t

PHP and Javascript
Hi Guys,

Im trying to load the contents of an html file into a text area for editing, this is

pointer 102 question
I read a book
1
2
3
4
5
6
7
8
9
10
11
12
int main() {

Encrypt php code?
Is it possible to encrypt php code in files,
so that it displays a load of unreadable characters

Delete all files in folder except with certain name
I have a script that I want to delete all files in a folder (taken from a database) except for one n

Help on Order Entry Form/System Where is best to begin.
I have a dilema and a very short amount of time at this point and I'm looking for some help on decid

PHP - HTML
Could anyone give me some GOOD sample links for php - html email tutorial.

Thanks!

Deleted Delivery but material wont return
We deleted a delivery but the material its still pending.

We made a reverse goods movemen

How would I convert this into code using an if statement?
ES equals exam score m equals $mean s equals $total. I already coded my mean and total so I'm not g

server trace logs
could any one tell me from where do i get error logs in xMII??I want to check the reason for dtabase

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