Opening realport tty devices

A little background: we are running Red Hat Enterprise Linux using version 1.9-6 of the realport driver.

The heart of the issue is that if we have a network failure or somebody powers off a one of our PortServer TS 8/16 devices the open call to a RealPort TTY device will never return.

I’ve seen some documentation suggesting using an alarm or setitimer call to interrupt the open call. Due to the nature of the application I need to use this device with and the heavy use of signals inside it this is an undesirable method.

Is there no way to configure the RealPort driver to return an ENXIO error when the device is unavailable so that the semantics of the open call aren’t broken?


Aside, from the following recomendation:

You could implement a TCP timeout that will timeout an idle connection. The minumum value is 50 seconds:

I actually got past my problem by using the O_NONBLOCK option on the open. It appears as though I get an errno 11, for temp. unavailable which I think I can live with. However, I’d still stand by the fact that if we cannot contact the device it is bad semantics to hold the open indefinitely when it seams to me to be a clear case in which an ENXIO error should be returned… especially considering often times we are talking about a WAN and not a LAN we have to deal with to communicate with the digi.