H
Hans Vlems
I'm asked to write a program that runs on a Windows or Linux host and
must set up a telnet connection to a network device. This network
device understands very basic commands (one or two letters) and
produces output, depending on the command. The proud owner of this hi-
tech device doesn't want to initiate a session from the command prompt
but rather run a program that issues the same command(-sequence) every
day and collects the output of the remote device.
My first idea was to have the C program build a command script and
start that script with the system() function.
Looks simple, but system() runs its script asynchronously, i.e. the
originating program has no control over the script.
Second idea: connect to the telnet port of the hi-tech device in the C
program. I'm a newbie in TCP/IP programming so there are a few
questions:
- is there a library with handy functions that I can use (Windows
based to start with)?
- does a network connection behave like a file on disk that can may be
read from or written to?
- a pointer to a book that explains these issues (preferably with easy
to understand pictures ;-)?
Hans
must set up a telnet connection to a network device. This network
device understands very basic commands (one or two letters) and
produces output, depending on the command. The proud owner of this hi-
tech device doesn't want to initiate a session from the command prompt
but rather run a program that issues the same command(-sequence) every
day and collects the output of the remote device.
My first idea was to have the C program build a command script and
start that script with the system() function.
Looks simple, but system() runs its script asynchronously, i.e. the
originating program has no control over the script.
Second idea: connect to the telnet port of the hi-tech device in the C
program. I'm a newbie in TCP/IP programming so there are a few
questions:
- is there a library with handy functions that I can use (Windows
based to start with)?
- does a network connection behave like a file on disk that can may be
read from or written to?
- a pointer to a book that explains these issues (preferably with easy
to understand pictures ;-)?
Hans