@Override
    public void start() {
        Socket socket = null;
        try {
            Long startTime = System.currentTimeMillis();
            socket = new Socket();
            try {
                socket.setSoTimeout(TIME_OUT);
            } catch (SocketException e) {
                e.printStackTrace();
            }
            socket.connect(new InetSocketAddress(mHost, mPort), TIME_OUT);
            if (isConnected = socket.isConnected())
                mDelay = System.currentTimeMillis() - startTime;
            else
                mError = Cmd.TCP_LINK_ERROR;
        } catch (UnknownHostException e) {
            mError = Cmd.UNKNOWN_HOST_ERROR;
        } catch (IOException e) {
            mError = Cmd.TCP_LINK_ERROR;
        } finally {
            if (socket != null) {
                try {
                    socket.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
Telnet service

@param host Service host
@param port Service port
caprice/kit-cmd/src/main/java/net/qiujuer/genius/kit/cmd/Telnet.java