select problem....

bridged with qdn.public.qnxrtp.porting
Post Reply
kc

select problem....

Post by kc » Tue Sep 24, 2002 2:09 pm

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

Re: select problem....

Post by Sean Boudreau » Tue Sep 24, 2002 6:32 pm

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

kc

Re: select problem....

Post by kc » Tue Sep 24, 2002 8:22 pm

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

Sean Boudreau

Re: select problem....

Post by Sean Boudreau » Wed Sep 25, 2002 4:50 pm

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

Post Reply

Return to “qdn.public.qnxrtp.porting”