I have a computer (say computer A) whenever computer A gets a connection over a particular telnet port, it launches a program.
this program on computer A handles login, authentication etc. One of the jobs it can do is receive files. It handles this by launching gKermit.
/usr/local/bin/gkermit -e 8000 -w -a /location/x/ -ir
I have a second program on computer B. This 2nd program will connect to computer A
mPid = forkpty(&mPort, buffer, &mCurrTermattr, NULL);
...
if child
{
execl("/usr/bin/telnet", "telnet", mComPort.name.c_str(), NULL);
}
now the parent process of the program can use the file descriptor mPort to send receive data. (i.e. like logging into computer A, and telling it to receive a file)
The problem is that when computer B launches gKermit to send a file, It cannot communicate with computer A gKermit.
system(gkermit -d gkermit.txt -X -e 8000 -i -s testfile.txt)
One would think if we are talking using mPort we could redirect the computer B system call stdio to use that mPort by doing:
dup2(mPort, STDIN_FILENO)
however this does not do the trick. Any help would be appreciated.