🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: 'could not bind socket' error

#727
From: Dennis Jones
Date: Wed, 21 Nov 2007 07:07
44 lines
3144 bytes
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:4743c58d$1@newsgroups.borland.com...
>
> "Dennis Jones" <nospam@nospam.com> wrote in message
> news:474384f3$1@newsgroups.borland.com...
>
>> The address is "" (an empty string).
>
> That will bind the server to all available IP addresses on the machine.

Yes, because that's exactly what I want.  The application allows the user to 
choose from one or more specific adapters (if desired), or "Any Available" 
adapter, in which case "" (empty string) is used to allow client connections 
from any adapter, regardless of its IP address.


>> In this particular case, the port number was 5018.
>
> And port 5018 does not appear anywhere in netstat -a or -b for any IP
> address or hostname while the error is occuring?

Yes, that is correct.  That's what's so frustrating about the whole thing. 
If netstat -a showed me that the port was in use, then at least I would know 
where to start looking.  But since it doesn't, I don't know if the problem 
is due to my application (failing to close the socket correctly in some 
unusual circumstance), or the OS doing something funky, or if it is 
something else entirely.

It seems reasonable that it could be caused by me killing the application 
since I do that on occasion via the debugger, but the error usually occurs 
when there has been such a long period of time since I last ran the 
application, that any memory of what I was doing at the time (or of how I 
closed it) has long since been forgotten.

I guess all I can do now is wait until it happens again and then see if I 
can find some way to figure out what's causing it.  Any suggestions on how 
to go about doing would be most welcome.  In the meantime, do you know of 
any way to clear the socket so that the IP/port can be used without having 
to reboot the machine?

Thanks for your time, Remy.

- Dennis 
Technical Details
Message-ID: <4743d916$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.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> <47436c88$1@newsgroups.borland.com> <474377e3$1@newsgroups.borland.com> <474384f3$1@newsgroups.borland.com> <4743c58d$1@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> <47436c88$1@newsgroups.borland.com> <474377e3$1@newsgroups.borland.com> <474384f3$1@newsgroups.borland.com> <4743c58d$1@newsgroups.borland.com>
Subject: Re: 'could not bind socket' error
Date: Tue, 20 Nov 2007 23:07:05 -0800
Lines: 46
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
NNTP-Posting-Host: 71.245.109.58
Message-ID: <4743d916$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1195628822 71.245.109.58 (20 Nov 2007 23:07:02 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.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