S
Scott
I am using a TCPIP connection to communicate over port 23 (telnet) to
a server,
and I am having to mimic normal command line interface you owuld see
in a telnet session (i.e. I have to write to this socket just like you
would enter things on the keyboard if you telneted to this server).
In a normal telnet session you can enter some commands which take a
long time to complete, and they run in the background and you get the
command line prompt back, you can hit <ctrl-d> on the keyboard to see
the status of the background task and see if you get a response like
"EXECUTED" or "WORKIGN", when you hit the <enter> again you will be
back at the command line to continue working.
Context is C++ on a Unix server:
My problem is I cannot programatically mimic a <ctrl-d> input through
the socket when required, so that I can read the background response.
I have tried writing/sending all sort's of characters to emulate the
keyboard sequence of ctrl-d. I am surprised that I cannot find
anything in the usergroups related to this problem, perhaps control
characters are most usually read but never sent?
I have tried the following, but it did not work:
const char ch='^D';
ptr=&ch[0];
size=1;
nwritten = write(socketDescriptor, ptr, size);
a server,
and I am having to mimic normal command line interface you owuld see
in a telnet session (i.e. I have to write to this socket just like you
would enter things on the keyboard if you telneted to this server).
In a normal telnet session you can enter some commands which take a
long time to complete, and they run in the background and you get the
command line prompt back, you can hit <ctrl-d> on the keyboard to see
the status of the background task and see if you get a response like
"EXECUTED" or "WORKIGN", when you hit the <enter> again you will be
back at the command line to continue working.
Context is C++ on a Unix server:
My problem is I cannot programatically mimic a <ctrl-d> input through
the socket when required, so that I can read the background response.
I have tried writing/sending all sort's of characters to emulate the
keyboard sequence of ctrl-d. I am surprised that I cannot find
anything in the usergroups related to this problem, perhaps control
characters are most usually read but never sent?
I have tried the following, but it did not work:
const char ch='^D';
ptr=&ch[0];
size=1;
nwritten = write(socketDescriptor, ptr, size);