0 votes
by (370 points)
edited

Is there any way to capture data on a virtualterminal other than Expect and Process ?

If not, can you provide me with ways to utilize each method ?

This is the code I'm using to kick off my virtualterminal:

telnet = new Telnet(aixServerName, port);
telnet.LogWriter = new Rebex.FileLogWriter("./MyLog.log", Rebex.LogLevel.Verbose);
vt = telnet.StartVirtualTerminal();

Thanks !

Chew

2 Answers

0 votes
by (370 points)
edited

I've thought about using Ssh and would like to do something like this:

socket = new Socket(server, port);
inCmd = new BufferedReader(new InputStreamReader(socket.getInputStream()));
outCmd = new PrintWriter(socket.getOutputStream());

This is Java but can't find a way to do something similar in C# with Rebex. This is not an FTP. I want to send/receive commands on a remote host (like unix/Linux) and read streams byte by byte.

Chew

0 votes
by (73.5k points)
edited

May be ShellChannel class can meet your requirements well. It is very easy to get it:

IShellChannelFactory telnet = new Telnet(server, port);
ShellChannel channel = telnet.CreateShellChannel(new TerminalOptions(), 80, 24);

Using ShellChannel class you can use Receive/Send methods to read/send data from/to the server.

...