Skip to content

Commit

Permalink
Merge pull request #5000 from CyberShadow/pull-20150831-100433
Browse files Browse the repository at this point in the history
fix Issue 14709 - dmd/samples/listener.d socket.accept exception hand…
  • Loading branch information
DmitryOlshansky committed Aug 31, 2015
2 parents 91884c6 + 90fe10c commit 969c85d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion samples/listener.d
Expand Up @@ -81,14 +81,15 @@ void main(string[] args)

if (socketSet.isSet(listener)) // connection request
{
Socket sn = listener.accept();
Socket sn = null;
scope (failure)
{
writefln("Error accepting");

if (sn)
sn.close();
}
sn = listener.accept();
assert(sn.isAlive);
assert(listener.isAlive);

Expand Down

0 comments on commit 969c85d

Please sign in to comment.