Problem with select()

Hi All,

I’ve a problem with the select() function after upgrading from NetOS6.0 to NetOS6.0e (for new Digi Connect ME).
I use the select() function with 2 socket and 1 uart filedescriptor.
The function crashes if where is data to read from the uart.
If I only use sockets with the select() function all works fine.
Can I use the select function of NetOS only with sockets?

Hardware: Digi Connect ME
Software: NetOS6.0e GNU

Thanks in advance

Christian

I don’t know about 6.0e, but with 6.0 it is sockets only.

-Erik

Christian (et. al.),

The use of select(), respective to other than sockets has been fixed in NET+OS 6.3.

Please contact Digi support regarding obtaining an upgrade from your current NET+OS version.

Support phone +1 (952) 912-3456
Support e-mail support.wizards@digi.com

Cameron

Thanks for your reply Erik.

But the problem only occurs in 6.0e. In 6.0 all works fine.
Do you know any trick to work with select() and serial line in NetOS? My application is a port from unix/linux.

Christian

I know several tricks with select() but all are with sockets. To do serial stuff, I use tcgetbuffers() to detect a signal. There is two ways that I handle serial interrupts at the same time as a select().

  1. Use more than one thread at a time. This generally works, but select() is non-reenterant, so you need to patch it so that it works in a multi-threaded environment. Look back a few threads in this forum - I posted a fix. Also if you use select() with a NULL timeout so that it returns immediately, you can put in a tcgetbuffers() to check the serial port.

  2. Use a socket pair with multiple threads. I don’t know about 6.0e, but 6.0 is slightly unstable with socket pairs, although it works most of the time. This will let you use select().

-Erik

Thanks Erik, I’ll try that.

Christian