/** * Connect to server * * @param host Address of server to connect to * @param port Port to connect to * @throws UnknownHostException * @throws IOException * @throws RdesktopException * @throws SocketException * @throws CryptoException * @throws OrderException */ public void connect(InetAddress host, int port) throws UnknownHostException, IOException, RdesktopException, SocketException, CryptoException, OrderException { if (Options.hostname == "") { InetAddress localhost = InetAddress.getLocalHost(); String name = localhost.getHostName(); StringTokenizer tok = new StringTokenizer(name, "."); Options.hostname = tok.nextToken(); Options.hostname.trim(); } RdpPacket_Localised mcs_data = this.sendMcsData(); McsLayer.connect(host, port, mcs_data); this.processMcsData(mcs_data); if (Constants.encryption) { this.establishKey(); } }