accept error - Unix

This is a discussion on accept error - Unix ; why accept function gives error ? I have done the following steps.. created socket bound the socket socket listens socket accept..(here it returns always -1)...

+ Reply to Thread
Results 1 to 8 of 8

Thread: accept error

  1. accept error

    why accept function gives error ?

    I have done the following steps..

    created socket
    bound the socket
    socket listens
    socket accept..(here it returns always -1)

  2. Re: accept error

    asit wrote in news:34ac6a6f-0861-4bfd-8cf6-
    15a3831b1065@a2g2000prm.googlegroups.com:

    > why accept function gives error ?
    >
    > I have done the following steps..
    >
    > created socket
    > bound the socket
    > socket listens
    > socket accept..(here it returns always -1)
    >


    On failure, accept sets errno to indicate the reason for
    the failure. What is the value returned in errno?

    MV

    --
    I do not want replies; please follow-up to the group.

  3. Re: accept error

    On Oct 7, 7:22 pm, Martin Vuille wrote:
    > asit wrote in news:34ac6a6f-0861-4bfd-8cf6-
    > 15a3831b1...@a2g2000prm.googlegroups.com:
    >
    > > why accept function gives error ?

    >
    > > I have done the following steps..

    >
    > > created socket
    > > bound the socket
    > > socket listens
    > > socket accept..(here it returns always -1)

    >
    > On failure, accept sets errno to indicate the reason for
    > the failure. What is the value returned in errno?
    >
    > MV
    >
    > --
    > I do not want replies; please follow-up to the group.


    how to retrive errorno ???

  4. Re: accept error

    asit wrote in news:81943ffe-fe09-45e0-82a6-
    35884046d344@40g2000prx.googlegroups.com:

    >>
    >> On failure, accept sets errno to indicate the reason for
    >> the failure. What is the value returned in errno?
    >>

    >
    > how to retrive errorno ???
    >


    Note: it's "errno", not "errorno"

    Try "man errno"
    You might also want to try "man perror" and "man accept"

    MV

    --
    I do not want replies; please follow-up to the group.

  5. Re: accept error

    On Oct 7, 7:47 pm, Martin Vuille wrote:
    > asit wrote in news:81943ffe-fe09-45e0-82a6-
    > 35884046d...@40g2000prx.googlegroups.com:
    >
    >
    >
    > >> On failure, accept sets errno to indicate the reason for
    > >> the failure. What is the value returned in errno?

    >
    > > how to retrive errorno ???

    >
    > Note: it's "errno", not "errorno"
    >
    > Try "man errno"
    > You might also want to try "man perror" and "man accept"
    >
    > MV
    >
    > --
    > I do not want replies; please follow-up to the group.


    I found it.....
    #include

    printf("%d",errno);

  6. Re: accept error

    On Oct 7, 6:39 pm, asit wrote:
    > On Oct 7, 7:47 pm, Martin Vuille wrote:
    >
    >
    >
    > > asit wrote in news:81943ffe-fe09-45e0-82a6-
    > > 35884046d...@40g2000prx.googlegroups.com:

    >
    > > >> On failure, accept sets errno to indicate the reason for
    > > >> the failure. What is the value returned in errno?

    >
    > > > how to retrive errorno ???

    >
    > > Note: it's "errno", not "errorno"

    >
    > > Try "man errno"
    > > You might also want to try "man perror" and "man accept"

    >
    > I found it.....
    > #include
    >
    > printf("%d",errno);


    Please don't quote sig blocks.
    Read your documentation with more care.
    It's , not .

  7. Re: accept error

    asit wrote in news:48e4638c-8eaf-48ca-8ff5-
    e05678da47af@w24g2000prd.googlegroups.com:

    >
    > I found it.....
    > #include
    >
    > printf("%d",errno);


    That will work. But likely your next question will be:
    "what does error code XX mean?"

    If you use perror(), it will print out a text string
    corresponding to the error, and that should make it
    easier for you to figure out what is going wrong.

    MV

    --
    I do not want replies; please follow-up to the group.

  8. Re: accept error

    On Oct 7, 10:25 pm, Martin Vuille wrote:
    > asit wrote in news:48e4638c-8eaf-48ca-8ff5-
    > e05678da4...@w24g2000prd.googlegroups.com:
    >
    >
    >
    > > I found it.....
    > > #include

    >
    > > printf("%d",errno);

    >
    > That will work. But likely your next question will be:
    > "what does error code XX mean?"
    >
    > If you use perror(), it will print out a text string
    > corresponding to the error, and that should make it
    > easier for you to figure out what is going wrong.
    >
    > MV
    >
    > --
    > I do not want replies; please follow-up to the group.


    Thanx..before than I was using google to understand the error code...

+ Reply to Thread