Problems w/ select()

Hi!

I have an application which uses select() to monitor the file descriptors
for stdio and 2 sockets. It works fine on the development PC. On the target
single-board computer w/ a watered down OS image, select() is not returning
when data is sent to the two sockets, but it does when data is sent to
stdio. Furthermore, if data was sent to the sockets and then a key is
pressed (thus triggering select through the stdio), the sockets are present
in the file descriptor set. So select saw them but did not return?!?

Any insight on this would be appreciated…

  • Ricardo

Ricardo <ricardo.fsi@attbi.com> wrote in news:at8lpg$t1o$1@inn.qnx.com:

Hi!

I have an application which uses select() to monitor the file
descriptors for stdio and 2 sockets. It works fine on the development
PC. On the target single-board computer w/ a watered down OS image,
select() is not returning when data is sent to the two sockets, but it
does when data is sent to stdio. Furthermore, if data was sent to the
sockets and then a key is pressed (thus triggering select through the
stdio), the sockets are present in the file descriptor set. So select
saw them but did not return?!?

Any insight on this would be appreciated…

  • Ricardo

Actually, just found out that if I comment out the stdio from the file
descriptors, everything works fine. SO… its the stdio that is somehow
messing things up for the socket descriptors.

  • Ricardo

Ricardo <rar@attbi.com> wrote in news:at8ucs$819$2@inn.qnx.com:

Ricardo <> ricardo.fsi@attbi.com> > wrote in news:at8lpg$t1o$> 1@inn.qnx.com> :

Hi!

I have an application which uses select() to monitor the file
descriptors for stdio and 2 sockets. It works fine on the development
PC. On the target single-board computer w/ a watered down OS image,
select() is not returning when data is sent to the two sockets, but it
does when data is sent to stdio. Furthermore, if data was sent to the
sockets and then a key is pressed (thus triggering select through the
stdio), the sockets are present in the file descriptor set. So select
saw them but did not return?!?

Any insight on this would be appreciated…

  • Ricardo

Actually, just found out that if I comment out the stdio from the file
descriptors, everything works fine. SO… its the stdio that is somehow
messing things up for the socket descriptors.

  • Ricardo

And… only happens if stdio is redirected to /dev/ser1. If stdio is a
telnet terminal it works fine.

  • Ricardo

Ricardo <ricardo.fsi@attbi.com> wrote:

Hi!

I have an application which uses select() to monitor the file descriptors
for stdio and 2 sockets. It works fine on the development PC. On the target
single-board computer w/ a watered down OS image, select() is not returning
when data is sent to the two sockets, but it does when data is sent to
stdio. Furthermore, if data was sent to the sockets and then a key is
pressed (thus triggering select through the stdio), the sockets are present
in the file descriptor set. So select saw them but did not return?!?

Any insight on this would be appreciated…

Which OS & version? Which serial port driver? Which TCP/IP stack?

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

David Gibbs <dagibbs@qnx.com> wrote in news:atabhh$qnp$1@nntp.qnx.com:

Ricardo <> ricardo.fsi@attbi.com> > wrote:
Hi!

I have an application which uses select() to monitor the file
descriptors for stdio and 2 sockets. It works fine on the development
PC. On the target single-board computer w/ a watered down OS image,
select() is not returning when data is sent to the two sockets, but
it does when data is sent to stdio. Furthermore, if data was sent to
the sockets and then a key is pressed (thus triggering select through
the stdio), the sockets are present in the file descriptor set. So
select saw them but did not return?!?

Any insight on this would be appreciated…

Which OS & version? Which serial port driver? Which TCP/IP stack?

-David

OS: QNX 6.2
Serial Driver: devc-ser8250
TCPIP: ttcpip

Only occurs when executing the app from the redirected (/dev/console =
/dev/ser1) terminal. AND if I give select() a timeout, it does not trigger
on the redirected terminal, but it does on a telnet terminal.

  • Ricardo