public int AddPort(IDebugPortRequest2 pRequest, out IDebugPort2 ppPort)
        {
            ppPort = null;

            string name;
            pRequest.GetPortName(out name);

            Match m = _portNameRegex.Match(name);
            if (!m.Success) {
                return Marshal.GetHRForException(new FormatException());
            }

            string secret = m.Groups["secret"].Value;
            string hostName = m.Groups["hostName"].Value;

            ushort portNum = _defaultPort;
            if (m.Groups["portNum"].Success) {
                if (!ushort.TryParse(m.Groups["portNum"].Value, out portNum)) {
                    return Marshal.GetHRForException(new FormatException());
                }
            }

            var port = new JRemoteDebugPort(this, hostName, portNum, secret, _useSsl);
            ppPort = port;
            return 0;
        }
Exemple #2
0
 public JRemoteDebugProcess(JRemoteDebugPort port, int pid, string exe, string username, string version)
 {
     this._port = port;
     this._pid = (pid == 0) ? 1 : pid; // attach dialog won't show processes with pid==0
     this._username = username;
     this._exe = string.IsNullOrEmpty(exe) ? "<python>" : exe;
     this._version = version;
 }