Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
package becroutertest;
import java.io.*;
import java.net.Socket;
/**
*
* @author redacted
*/
public class BecRouterTest {
public Socket connect;
public InputStreamReader input;
public OutputStreamWriter output;
public BecRouterTest(InputStreamReader a, OutputStreamWriter b, Socket c){
connect = c;
input = a;
output = b;
}
public void readAndWrite() throws java.io.IOException {
int c;
char p;
while((c=input.read()) != -1){
p = (char) c;
System.out.print(p);
}
}
public static void main(String[] args) throws java.io.IOException{
String IPAddress = "<IP I'm Trying to access>";
int Port = 23; // Default port for Telnet
Socket connection = new Socket(IPAddress, Port);
connection.setKeepAlive(true); // Keep the connection alive
InputStreamReader in = new InputStreamReader(connection.getInputStream());
OutputStreamWriter out = new OutputStreamWriter(connection.getOutputStream());
BecRouterTest contact = new BecRouterTest(in, out, connection);
contact.readAndWrite();
contact.output.write("<Login Password>\r\n");
contact.output.flush();
contact.readAndWrite();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.