🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #723

Re: 'could not bind socket' error

#723
From: Dennis Jones
Date: Tue, 20 Nov 2007 23:23
48 lines
3189 bytes
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:474358f3@newsgroups.borland.com...
>
>> Yes, that is correct, it is a server socket.
>
> Ok.  Then you (or someone else) opened that IP/Port and didn't close it 
> before you tried to activate a new server on it.

But that's just it...I didn't!


> Something else to keep in mind - when a socket is closed, it is not FULLY 
> closed right away.  The OS keeps it alive for an extra period of time in 
> order to ensure any pending data gets handled at the network layer.

Yes, I am aware of that.  That is actually the reason I mentioned that it 
was the first time I had run the app in over a day -- because that would 
have been more than enough time for the OS to close the socket.


>> So if netstat does *not* show the port is in use
>
> It will, otherwise you would not be getting the error.
>
>> why would the server socket complain that it *is* in use?
>
> It wouldn't, if it is not in netstat's listing.

So you keep saying.  And in fact, that is exactly the reason I checked 
netstat in the first place.  I assumed netstat would be accurate (but maybe 
it's not).  The fact that netstat does not show the port in use is the only 
reason I asked the question to begin with.  If netstat had listed the port, 
it would have been obvious that there was a problem with closing the socket 
and I wouldn't have bothered posting here!

The only potential cause that I can think of is if I happened to forcibly 
close the application yesterday (via the integrated debugger, for instance, 
using Ctrl+F2), though I have no recollection of doing that (I don't even 
remember running the app yseterday).  But even if I did, that still does not 
explain why "netstat -a" does not show the port number in use!

So, being certain that netstat does not show the port in use, and being 
certain that the app is not already running, what would you suggest I do the 
next time this occurs?  I'd really like to get to the bottom of this because 
rebooting the machine when it happens is a real nuisance.

- Dennis 
Technical Details
Message-ID: <47436c88$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <47431d9f$1@newsgroups.borland.com> <474342ce@newsgroups.borland.com> <47434723$1@newsgroups.borland.com> <474358f3@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,128d041863311899
X-Google-Attributes: gid11508e,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Dennis Jones" <nospam@nospam.com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <47431d9f$1@newsgroups.borland.com> <474342ce@newsgroups.borland.com> <47434723$1@newsgroups.borland.com> <474358f3@newsgroups.borland.com>
Subject: Re: 'could not bind socket' error
Date: Tue, 20 Nov 2007 15:23:53 -0800
Lines: 50
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
NNTP-Posting-Host: 71.245.109.58
Message-ID: <47436c88$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1195601032 71.245.109.58 (20 Nov 2007 15:23:52 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail