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)
Printable View
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)
asit <lipun4u@gmail.com> wrote in news:34ac6a6f-0861-4bfd-8cf6-
[email]15a3831b1065@a2g2000prm.googlegroups.com[/email]:
[color=blue]
> 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)
>[/color]
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.
On Oct 7, 7:22 pm, Martin Vuille <jpm...@yahoo.com> wrote:[color=blue]
> asit <lipu...@gmail.com> wrote in news:34ac6a6f-0861-4bfd-8cf6-
> 15a3831b1...@a2g2000prm.googlegroups.com:
>[color=green]
> > why accept function gives error ?[/color]
>[color=green]
> > I have done the following steps..[/color]
>[color=green]
> > created socket
> > bound the socket
> > socket listens
> > socket accept..(here it returns always -1)[/color]
>
> 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.[/color]
how to retrive errorno ???
asit <lipun4u@gmail.com> wrote in news:81943ffe-fe09-45e0-82a6-
[email]35884046d344@40g2000prx.googlegroups.com[/email]:
[color=blue][color=green]
>>
>> On failure, accept sets errno to indicate the reason for
>> the failure. What is the value returned in errno?
>>[/color]
>
> how to retrive errorno ???
>[/color]
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.
On Oct 7, 7:47 pm, Martin Vuille <jpm...@yahoo.com> wrote:[color=blue]
> asit <lipu...@gmail.com> wrote in news:81943ffe-fe09-45e0-82a6-
> 35884046d...@40g2000prx.googlegroups.com:
>
>
>[color=green][color=darkred]
> >> On failure, accept sets errno to indicate the reason for
> >> the failure. What is the value returned in errno?[/color][/color]
>[color=green]
> > how to retrive errorno ???[/color]
>
> 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.[/color]
I found it.....
#include <error.h>
printf("%d",errno);
On Oct 7, 6:39 pm, asit <lipu...@gmail.com> wrote:[color=blue]
> On Oct 7, 7:47 pm, Martin Vuille <jpm...@yahoo.com> wrote:
>
>
>[color=green]
> > asit <lipu...@gmail.com> wrote in news:81943ffe-fe09-45e0-82a6-
> > 35884046d...@40g2000prx.googlegroups.com:[/color]
>[color=green][color=darkred]
> > >> On failure, accept sets errno to indicate the reason for
> > >> the failure. What is the value returned in errno?[/color][/color]
>[color=green][color=darkred]
> > > how to retrive errorno ???[/color][/color]
>[color=green]
> > Note: it's "errno", not "errorno"[/color]
>[color=green]
> > Try "man errno"
> > You might also want to try "man perror" and "man accept"[/color]
>
> I found it.....
> #include <error.h>
>
> printf("%d",errno);[/color]
Please don't quote sig blocks.
Read your documentation with more care.
It's <errno.h>, not <error.h>.
asit <lipun4u@gmail.com> wrote in news:48e4638c-8eaf-48ca-8ff5-
[email]e05678da47af@w24g2000prd.googlegroups.com[/email]:
[color=blue]
>
> I found it.....
> #include <error.h>
>
> printf("%d",errno);[/color]
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.
On Oct 7, 10:25 pm, Martin Vuille <jpm...@yahoo.com> wrote:[color=blue]
> asit <lipu...@gmail.com> wrote in news:48e4638c-8eaf-48ca-8ff5-
> e05678da4...@w24g2000prd.googlegroups.com:
>
>
>[color=green]
> > I found it.....
> > #include <error.h>[/color]
>[color=green]
> > printf("%d",errno);[/color]
>
> 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.[/color]
Thanx..before than I was using google to understand the error code...