public virtual void Open() { if (this.IsOpen) { throw new SessionAlreadyOpenException(); } // Rather then just checking our own tunnels, just go over TCP listeners. foreach (Tunnel tunnel in this.Tunnels) { IPGlobalProperties ipGlobalProperties = IPGlobalProperties.GetIPGlobalProperties(); IPEndPoint[] ipEndPoints = ipGlobalProperties.GetActiveTcpListeners(); foreach (IPEndPoint ipEndPoint in ipEndPoints) { if (ipEndPoint.Port == tunnel.SourcePort) { throw new PortAlreadyInUseException(tunnel); } } } this.puttyLink = new PuttyLink(this); Thread thread = new Thread(new ThreadStart(this.puttyLink.Start)); thread.IsBackground = true; thread.Start(); //OpenSessions.Add(this); }
public virtual void Close() { if (this.IsOpen) { this.puttyLink.Stop(); } //if (OpenSessions.Contains(this)) // OpenSessions.Remove(this); this.puttyLink = null; }
public Session(string name, string hostname, int port) { this.name = name; this.hostname = hostname; this.username = ""; this.port = port; this.compression = false; this.localPortsAcceptAll = false; this.tunnels = new List<Tunnel>(); this.usePtmForTunnels = false; this.puttyLink = null; this.resume = false; SystemEvents.PowerModeChanged += new PowerModeChangedEventHandler(SystemEvents_PowerModeChanged); }
public Session(string name, string hostname, int port) { this.name = name; this.hostname = hostname; this.username = ""; this.port = port; this.compression = false; this.localPortsAcceptAll = false; this.tunnels = new List <Tunnel>(); this.usePtmForTunnels = false; this.puttyLink = null; this.resume = false; SystemEvents.PowerModeChanged += new PowerModeChangedEventHandler(SystemEvents_PowerModeChanged); }
public virtual void Open() { if (this.IsOpen) throw new SessionAlreadyOpenException(); // Rather then just checking our own tunnels, just go over TCP listeners. foreach (Tunnel tunnel in this.Tunnels) { IPGlobalProperties ipGlobalProperties = IPGlobalProperties.GetIPGlobalProperties(); IPEndPoint[] ipEndPoints = ipGlobalProperties.GetActiveTcpListeners(); foreach (IPEndPoint ipEndPoint in ipEndPoints) { if (ipEndPoint.Port == tunnel.SourcePort) { throw new PortAlreadyInUseException(tunnel); } } } this.puttyLink = new PuttyLink(this); Thread thread = new Thread(new ThreadStart(this.puttyLink.Start)); thread.IsBackground = true; thread.Start(); //OpenSessions.Add(this); }
public virtual void Close() { if (this.IsOpen) this.puttyLink.Stop(); //if (OpenSessions.Contains(this)) // OpenSessions.Remove(this); this.puttyLink = null; }