Create a gist now

Instantly share code, notes, and snippets.

anonymous /gist:af529233b026c7d2726b
Created May 21, 2014

package becroutertest;
* @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 {
int c;
char p;
while(( != -1){
p = (char) c;
public static void main(String[] args) throws{
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.output.write("<Login Password>\r\n");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment