예제 #1
0
        public static SocketWithTimeout StartNewConnection(ISocketWithTimeoutClient client, TCPTerminalParam param, string password, HostKeyCheckCallback keycheck)
        {
            Size sz = GEnv.Frame.TerminalSizeForNextConnection;
            //Size sz = new System.Drawing.Size(528, 316);

            SocketWithTimeout swt;

            if (param.Method == ConnectionMethod.Telnet)            //Telnet
            {
                swt = new TelnetConnector((TelnetTerminalParam)param, sz);
            }
            else               //SSH
            {
                swt = new SSHConnector((SSHTerminalParam)param, sz, password, keycheck);
            }

            if (GEnv.Options.UseSocks)
            {
                swt.AsyncConnect(client, CreateSocksParam(param.Host, param.Port));
            }
            else
            {
                swt.AsyncConnect(client, param.Host, param.Port);
            }
            return(swt);
        }
예제 #2
0
        public static Connector AsyncPrepareSocket(ISocketWithTimeoutClient client, LocalShellTerminalParam param)
        {
            Connector c = new Connector(param, client);

            GUtil.CreateThread(new ThreadStart(c.AsyncConnect)).Start();
            return(c);
        }
예제 #3
0
        public void AsyncConnect(ISocketWithTimeoutClient client, Socks socks)
        {
            _async  = true;
            _client = client;
            _event  = null;
            _socks  = socks;

            UI.UILibUtil.CreateThread(new ThreadStart(this.Run)).Start();
        }
예제 #4
0
 public static SocketWithTimeout StartNewConnection(ISocketWithTimeoutClient client, ChannelProfile prof, string password, HostKeyCheckCallback keycheck) {
     SocketWithTimeout swt;
     swt = new SSHConnector(prof, password, keycheck);
     /*
     if (Env.Options.UseSocks)
         swt.AsyncConnect(client, CreateSocksParam(prof.SSHHost, prof.SSHPort));
     else*/
     swt.AsyncConnect(client, prof.SSHHost, prof.SSHPort);
     return swt;
 }
예제 #5
0
        public void AsyncConnect(ISocketWithTimeoutClient client, string host, int port) {
            _async = true;
            _client = client;
            _event = null;
            _host = host;
            _port = port;
            //_socks = null;

            Util.CreateThread(new ThreadStart(this.Run)).Start();
        }
예제 #6
0
        public void AsyncConnect(ISocketWithTimeoutClient client, string host, int port, Action <ConnectionTag, string> connectResultProcess)
        {
            _async  = true;
            _client = client;
            _event  = null;
            _host   = host;
            _port   = port;
            _socks  = null;
            _connectResultProcess = connectResultProcess;

            UI.UILibUtil.CreateThread(new ThreadStart(this.Run)).Start();
        }
예제 #7
0
        public static SocketWithTimeout StartNewConnection(ISocketWithTimeoutClient client, ChannelProfile prof, string password, VerifySSHHostKeyDelegate keycheck)
        {
            SocketWithTimeout swt;

            swt = new SSHConnector(prof, password, keycheck);

            /*
             * if (Env.Options.UseSocks)
             *  swt.AsyncConnect(client, CreateSocksParam(prof.SSHHost, prof.SSHPort));
             * else*/
            swt.AsyncConnect(client, prof.SSHHost, prof.SSHPort);
            return(swt);
        }
예제 #8
0
 public static Connector AsyncPrepareSocket(ISocketWithTimeoutClient client, LocalShellTerminalParam param)
 {
     Connector c = new Connector(param, client);
     GUtil.CreateThread(new ThreadStart(c.AsyncConnect)).Start();
     return c;
 }
예제 #9
0
 public Connector(LocalShellTerminalParam param, ISocketWithTimeoutClient client)
 {
     _param = param;
     _client = client;
 }
예제 #10
0
        public static SocketWithTimeout StartNewConnection(ISocketWithTimeoutClient client, TCPTerminalParam param, string password, HostKeyCheckCallback keycheck)
        {
            Size sz = GEnv.Frame.TerminalSizeForNextConnection;

            SocketWithTimeout swt;
            if(param.Method==ConnectionMethod.Telnet) { //Telnet
                swt = new TelnetConnector((TelnetTerminalParam)param, sz);
            }
            else { //SSH
                swt = new SSHConnector((SSHTerminalParam)param, sz, password, keycheck);
            }

            if(GEnv.Options.UseSocks)
                swt.AsyncConnect(client, CreateSocksParam(param.Host, param.Port));
            else
                swt.AsyncConnect(client, param.Host, param.Port);
            return swt;
        }
예제 #11
0
        public void AsyncConnect(ISocketWithTimeoutClient client, Socks socks)
        {
            _async = true;
            _client = client;
            _event = null;
            _socks = socks;

            UI.UILibUtil.CreateThread(new ThreadStart(this.Run)).Start();
        }
예제 #12
0
 public Connector(LocalShellTerminalParam param, ISocketWithTimeoutClient client)
 {
     _param  = param;
     _client = client;
 }