Re: Converting serial I/O to ethernet I/O



tadamsmar wrote:

The manual says it uses the the same commands over RS-232 and
Ethernet. Over Ethernet, it uses TCP/IP and port 9880.

You need to determine if it is raw TCPIP, some Telnet protocol or raw UDP.

Telnet is *almost* raw, but it has a few escape sequences to send certain control characters transparently.

If your serial IO uses $QIO, it can be converted to TCPIP without major surgery. However, the TCPIP implementation on VMS does NOT support timeouts like the serial driver does.

So if your app makes use of SS$M_TIMEOUT (just look for TIMEOUT), then you need to write your own jacket QIO routines that do a synchronous read with an event flag, and a set a time with another event flag, and then wait for any of the 2 flags to be set ($WAITEF), and if it is the timer flag that gets set first, you know you have a timeout condition.

Handling disconnection is not as obvious.

Download and print the TCPIP Services System Services and C Socket programming manual, and then look in the sys$examples as you will have examples there.

If your app is AST driven without any timeouts, you can pretty well function the same way as before, with only the call setup being vastly different.
.