[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
27
Other forums
BIG file upload!
Hey guys!
I'm trying to upload a file, it works well with smaller files but with 60mb+, I get
Can't get the unicode character
I'm trying to get some text from various parts of a file. I have converted the file to hex (bin2hex)
browse folder only
hi,
is there a way i can browse or get the directory or folder only and not the file?
i just w
url- go to webpage
i have an input text field and submit button.
how do i make the url entered into the textfiel
Email logic not working
I would like to send an email using the php email() function then if it does execute i.e sends i wou
Help on query replacing the date
Hi Pals,
i want to replace the current date in a column to some value say C or D or any n
Typing math
I've added support for typesetting math using LaTeX on the forums.
Example:
Code: [Select]
ME54/ME54N Conditional check for Release of PR
Hi Gurus,
My requirement is to put a check on the release of the PR with respect to the c
Posting to another Site?
I have software that people install.
When they install it, is there a way to make it post their d
Problems with returning true or false in eval()'d code
Hi guys,
Would appreciate some help with a problem when running eval() on a function that sho