Note that there are some explanatory texts on larger screens.

plurals
  1. POSocket still listening after application crash
    primarykey
    data
    text
    <p>I'm having a problem with one of my C++ applications on Windows 2008x64 (same app runs just fine on Windows 2003x64). </p> <p>After a crash or even sometimes after a regular shutdown/restart cycle it has a problem using a socket on port 82 it needs to receive commands. </p> <p>Looking at netstat I see the socket is still in listening state more than 10 minutes after the application stopped (the process is definitely not running anymore).</p> <pre><code> TCP 0.0.0.0:82 LISTENING </code></pre> <p>I tried setting the socket option to REUSEADDR but as far as I know that only affects re-connecting to a port that's in TIME_WAIT state. Either way this change didn't seem to make any difference.</p> <pre><code>int doReuse = 1; setsockopt(listenFd, SOL_SOCKET, SO_REUSEADDR, (const char *)&amp;doReuse, sizeof(doReuse)); </code></pre> <p>Any ideas what I can do to solve or at least avoid this problem?</p> <p><strong>EDIT:</strong></p> <p>Did netstat -an but this is all I am getting:</p> <pre><code> TCP 0.0.0.0:82 0.0.0.0:0 LISTENING </code></pre> <p>For netstat -anb I get:</p> <pre><code> TCP 0.0.0.0:82 0.0.0.0:0 LISTENING [System] </code></pre> <p>I'm aware of shutting down gracefully, but even if the app crashes for some reason I still need to be able to restart it. The application in question uses an in-house library that internally uses Windows Sockets API.</p> <p><strong>EDIT:</strong></p> <p>Apparently there is no solution for this problem, so for development I will go with a proxy / tool to work around it. Thanks for all the suggestions, much appreciated.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload