Re: bins and setsockopt - Unix

This is a discussion on Re: bins and setsockopt - Unix ; On Oct 7, 2:44 pm, asit 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 ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Re: bins and setsockopt

  1. Re: bins and setsockopt

    On Oct 7, 2:44 pm, asit 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.


  2. Re: bins and setsockopt

    In article ,
    wrote:
    >On Oct 7, 2:44 pm, asit 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!


+ Reply to Thread