Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: bins and setsockopt

0 views
Skip to first unread message

vipp...@gmail.com

unread,
Oct 7, 2008, 7:55:58 AM10/7/08
to
On Oct 7, 2:44 pm, asit <lipu...@gmail.com> wrote:
> bind returns error when a port is already in use ....some process may
> be using it or the port may be just port is not used still it is
> hanging around kernel...
>
> how can i kinow the difference between these ????

Off-topic for comp.lang.c

Please ask in comp.unix.programmer, where it's more appropriate,
assuming you're talking about POSIX bind.
(I'm setting follow-ups there)

You can examine errno.

if(bind(...) == -1) {
if(errno == EADDRINUSE) { /* ... */ }
else if(...)
}

The errors are listed in the following link, under ERRORS.
<http://www.opengroup.org/onlinepubs/009695399/functions/bind.html>

Kenny McCormack

unread,
Oct 8, 2008, 11:40:25 PM10/8/08
to
In article <b5ca1eed-d849-4b19...@y29g2000hsf.googlegroups.com>,

<vipp...@gmail.com> wrote:
>On Oct 7, 2:44 pm, asit <lipu...@gmail.com> wrote:
>> bind returns error when a port is already in use ....some process may
>> be using it or the port may be just port is not used still it is
>> hanging around kernel...
>>
>> how can i kinow the difference between these ????
>
>Off-topic for comp.lang.c
>
>Please ask in comp.unix.programmer, where it's more appropriate,
>assuming you're talking about POSIX bind.

Um, this *is* comp.unix.programmer!

0 new messages