Datasheet
API in Java
94
* to get IP address of the connection. Reads data from socket created.
* @return InetAddress
*/
public InetAddress getIpAddress() {
return sock == null ? null : sock.getInetAddress();
}
/**
* returns ip address that socket is asociated with.
* @return InetAddress
*/
public InetAddress getLocalIpAddress() {
return sock == null ? null : sock.getLocalAddress();
}
/**
* Socket remote port number
* @return
*/
public int getPort() {
return sock == null ? null : sock.getPort();
}
/**
* return local prot used by socket
* @return
*/
public int getLocalPort() {
return sock == null ? null : sock.getLocalPort();
}
/**
* Returns status message set up bu class.
* @return
*/
public String getMessage() {
return message;
}
/**
* sets and exectues command (sends it to RouterOS host connected)
* @param s - command will be sent to RouterOS for example "/ip/address/print\n=follow="
* @return
*/
public String sendCommand(String s) {
return writeCommand.setCommand(s).runCommand();
}










