select problem....

Hi all,

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.

Thanks in advance.
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.

-seanb

kc <kclee@netnobound.com> wrote:

Hi all,

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.

Thanks in advance.
kc

Sean Boudreau wrote:

Hi sean,

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.

-seanb

kc <> kclee@netnobound.com> > wrote:
Hi all,

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.

Thanks in advance.
kc

Can you post a test case?

-seanb

kc <kclee@netnobound.com> wrote:

Sean Boudreau wrote:

Hi sean,

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.

-seanb

kc <> kclee@netnobound.com> > wrote:
Hi all,

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.

Thanks in advance.
kc