Well, the question probably belongs to some other newsgroups, but
since I am working on QNX…
I create a socket, and connect to other side, then sending and receiving
something without any problem. Then I change the code a bit. Before
the “send” I try to use select with timeout to see when is ok to send.
Similarly, I do the same before I “receive”.Everything seems working fine in
a simple test program.
However, When I intergate with my project, the “select” always waits till
time out and returns EAGAIN (Resource temporarily unavailable) on both send
and receive. As soon as I remove those “select” calls. I can send and
receive without problem. I am not sure what is going on. Maybe someone can
give me some ideas how to narrow down the cause.
EAGAIN is also EWOULDBLOCK which, if the socket was marked
as nonblocking, would make sense if the select() timed out
and you proceeded to operate on it anyway.
Well, the question probably belongs to some other newsgroups, but
since I am working on QNX…
I create a socket, and connect to other side, then sending and receiving
something without any problem. Then I change the code a bit. Before
the “send” I try to use select with timeout to see when is ok to send.
Similarly, I do the same before I “receive”.Everything seems working fine in
a simple test program.
However, When I intergate with my project, the “select” always waits till
time out and returns EAGAIN (Resource temporarily unavailable) on both send
and receive. As soon as I remove those “select” calls. I can send and
receive without problem. I am not sure what is going on. Maybe someone can
give me some ideas how to narrow down the cause.
It doesnt make sense at least to me. If it always behaves
this way, I can understand. In my case, “select” is basically
blocking everything, even the socket is ready to send or receive.
Thanks
kc
EAGAIN is also EWOULDBLOCK which, if the socket was marked
as nonblocking, would make sense if the select() timed out
and you proceeded to operate on it anyway.
Well, the question probably belongs to some other newsgroups, but
since I am working on QNX…
I create a socket, and connect to other side, then sending and receiving
something without any problem. Then I change the code a bit. Before
the “send” I try to use select with timeout to see when is ok to send.
Similarly, I do the same before I “receive”.Everything seems working fine
in a simple test program.
However, When I intergate with my project, the “select” always waits till
time out and returns EAGAIN (Resource temporarily unavailable) on both
send and receive. As soon as I remove those “select” calls. I can send
and receive without problem. I am not sure what is going on. Maybe
someone can give me some ideas how to narrow down the cause.
It doesnt make sense at least to me. If it always behaves
this way, I can understand. In my case, “select” is basically
blocking everything, even the socket is ready to send or receive.
Thanks
kc
EAGAIN is also EWOULDBLOCK which, if the socket was marked
as nonblocking, would make sense if the select() timed out
and you proceeded to operate on it anyway.
Well, the question probably belongs to some other newsgroups, but
since I am working on QNX…
I create a socket, and connect to other side, then sending and receiving
something without any problem. Then I change the code a bit. Before
the “send” I try to use select with timeout to see when is ok to send.
Similarly, I do the same before I “receive”.Everything seems working fine
in a simple test program.
However, When I intergate with my project, the “select” always waits till
time out and returns EAGAIN (Resource temporarily unavailable) on both
send and receive. As soon as I remove those “select” calls. I can send
and receive without problem. I am not sure what is going on. Maybe
someone can give me some ideas how to narrow down the cause.