We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
PTVSD fails to run on windows
```
Traceback (most recent call last):
  File "C:\Users\karth\.vscode\extensions\ms-python.python-2018.3.1\pythonFiles\experimental\ptvsd_launcher.py", line 96,
in <module>
    vspd.debug(filename, port_num, debug_id, debug_options, run_as)
  File "c:\git\ptvsd\ptvsd\debugger.py", line 36, in debug
    run(address, filename, *args, **kwargs)
  File "c:\git\ptvsd\ptvsd\__main__.py", line 37, in run_file
    run(argv, addr, **kwargs)
  File "c:\git\ptvsd\ptvsd\__main__.py", line 85, in _run
    daemon = _install(_pydevd, addr, **kwargs)
  File "c:\git\ptvsd\ptvsd\pydevd_hooks.py", line 52, in install
    daemon = Daemon(**kwargs)
  File "c:\git\ptvsd\ptvsd\daemon.py", line 53, in __init__
    self.install_exit_handlers()
  File "c:\git\ptvsd\ptvsd\daemon.py", line 91, in install_exit_handlers
    signal.SIGHUP: [],
AttributeError: module 'signal' has no attribute 'SIGHUP'
```
PTVSD fails to run on windows
```
Traceback (most recent call last):
  File "C:\Users\karth\.vscode\extensions\ms-python.python-2018.3.1\pythonFiles\experimental\ptvsd_launcher.py", line 96,
in <module>
    vspd.debug(filename, port_num, debug_id, debug_options, run_as)
  File "c:\git\ptvsd\ptvsd\debugger.py", line 36, in debug
    run(address, filename, *args, **kwargs)
  File "c:\git\ptvsd\ptvsd\__main__.py", line 37, in run_file
    run(argv, addr, **kwargs)
  File "c:\git\ptvsd\ptvsd\__main__.py", line 85, in _run
    daemon = _install(_pydevd, addr, **kwargs)
  File "c:\git\ptvsd\ptvsd\pydevd_hooks.py", line 52, in install
    daemon = Daemon(**kwargs)
  File "c:\git\ptvsd\ptvsd\daemon.py", line 53, in __init__
    self.install_exit_handlers()
  File "c:\git\ptvsd\ptvsd\daemon.py", line 91, in install_exit_handlers
    signal.SIGHUP: [],
AttributeError: module 'signal' has no attribute 'SIGHUP'
```

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `ptvsd/daemon.py`
Content:
```
1 import atexit
2 import os
3 import platform
4 import signal
5 import sys
6 
7 from ptvsd import wrapper
8 from ptvsd.socket import close_socket
9 
10 
11 def _wait_on_exit():
12     if sys.__stdout__ is not None:
13         try:
14             import msvcrt
15         except ImportError:
16             sys.__stdout__.write('Press Enter to continue . . . ')
17             sys.__stdout__.flush()
18             sys.__stdin__.read(1)
19         else:
20             sys.__stdout__.write('Press any key to continue . . . ')
21             sys.__stdout__.flush()
22             msvcrt.getch()
23 
24 
25 class DaemonClosedError(RuntimeError):
26     """Indicates that a Daemon was unexpectedly closed."""
27     def __init__(self, msg='closed'):
28         super(DaemonClosedError, self).__init__(msg)
29 
30 
31 class Daemon(object):
32     """The process-level manager for the VSC protocol debug adapter."""
33 
34     exitcode = 0
35 
36     def __init__(self, wait_on_exit=_wait_on_exit,
37                  addhandlers=True, killonclose=True):
38         self.wait_on_exit = wait_on_exit
39         self.killonclose = killonclose
40 
41         self._closed = False
42         self._exiting_via_atexit_handler = False
43 
44         self._pydevd = None
45         self._server = None
46         self._client = None
47         self._adapter = None
48 
49         self._signal_handlers = None
50         self._atexit_handlers = None
51         self._handlers_installed = False
52         if addhandlers:
53             self.install_exit_handlers()
54 
55     @property
56     def pydevd(self):
57         return self._pydevd
58 
59     @property
60     def server(self):
61         return self._server
62 
63     @property
64     def client(self):
65         return self._client
66 
67     @property
68     def adapter(self):
69         return self._adapter
70 
71     def start(self, server=None):
72         """Return the "socket" to use for pydevd after setting it up."""
73         if self._closed:
74             raise DaemonClosedError()
75         if self._pydevd is not None:
76             raise RuntimeError('already started')
77         self._pydevd = wrapper.PydevdSocket(
78             self._handle_pydevd_message,
79             self._handle_pydevd_close,
80             self._getpeername,
81             self._getsockname,
82         )
83         self._server = server
84         return self._pydevd
85 
86     def install_exit_handlers(self):
87         """Set the placeholder handlers."""
88         if self._signal_handlers is not None:
89             raise RuntimeError('exit handlers already installed')
90         self._signal_handlers = {
91             signal.SIGHUP: [],
92         }
93         self._atexit_handlers = []
94 
95         if platform.system() != 'Windows':
96             try:
97                 for sig in self._signal_handlers:
98                     signal.signal(sig, self._signal_handler)
99             except ValueError:
100                 # Wasn't called in main thread!
101                 raise
102         atexit.register(self._atexit_handler)
103 
104     def set_connection(self, client):
105         """Set the client socket to use for the debug adapter.
106 
107         A VSC message loop is started for the client.
108         """
109         if self._closed:
110             raise DaemonClosedError()
111         if self._pydevd is None:
112             raise RuntimeError('not started yet')
113         if self._client is not None:
114             raise RuntimeError('connection already set')
115         self._client = client
116 
117         self._adapter = wrapper.VSCodeMessageProcessor(
118             client,
119             self._pydevd.pydevd_notify,
120             self._pydevd.pydevd_request,
121             self._handle_vsc_disconnect,
122             self._handle_vsc_close,
123         )
124         name = 'ptvsd.Client' if self._server is None else 'ptvsd.Server'
125         self._adapter.start(name)
126         if self._signal_handlers is not None:
127             self._add_signal_handlers()
128             self._add_atexit_handler()
129         return self._adapter
130 
131     def close(self):
132         """Stop all loops and release all resources."""
133         if self._closed:
134             raise DaemonClosedError('already closed')
135         self._closed = True
136 
137         if self._adapter is not None:
138             normal, abnormal = self._adapter._wait_options()
139             if (normal and not self.exitcode) or (abnormal and self.exitcode):
140                 self.wait_on_exit()
141 
142         if self._pydevd is not None:
143             close_socket(self._pydevd)
144         if self._client is not None:
145             self._release_connection()
146 
147     def re_build_breakpoints(self):
148         self.adapter.re_build_breakpoints()
149 
150     # internal methods
151 
152     def _signal_handler(self, signum, frame):
153         for handle_signal in self._signal_handlers.get(signum, ()):
154             handle_signal(signum, frame)
155 
156     def _atexit_handler(self):
157         for handle_atexit in self._atexit_handlers:
158             handle_atexit()
159 
160     def _add_atexit_handler(self):
161         def handler():
162             self._exiting_via_atexit_handler = True
163             if not self._closed:
164                 self.close()
165             if self._adapter is not None:
166                 # TODO: Do this in VSCodeMessageProcessor.close()?
167                 self._adapter._wait_for_server_thread()
168         self._atexit_handlers.append(handler)
169 
170     def _add_signal_handlers(self):
171         def handler(signum, frame):
172             if not self._closed:
173                 self.close()
174             sys.exit(0)
175         self._signal_handlers[signal.SIGHUP].append(handler)
176 
177     def _release_connection(self):
178         if self._adapter is not None:
179             # TODO: This is not correct in the "attach" case.
180             self._adapter.handle_pydevd_stopped(self.exitcode)
181             self._adapter.close()
182         close_socket(self._client)
183 
184     # internal methods for PyDevdSocket().
185 
186     def _handle_pydevd_message(self, cmdid, seq, text):
187         if self._adapter is not None:
188             self._adapter.on_pydevd_event(cmdid, seq, text)
189 
190     def _handle_pydevd_close(self):
191         if self._closed:
192             return
193         self.close()
194 
195     def _getpeername(self):
196         if self._client is None:
197             raise NotImplementedError
198         return self._client.getpeername()
199 
200     def _getsockname(self):
201         if self._client is None:
202             raise NotImplementedError
203         return self._client.getsockname()
204 
205     # internal methods for VSCodeMessageProcessor
206 
207     def _handle_vsc_disconnect(self, kill=False):
208         if not self._closed:
209             self.close()
210         if kill and self.killonclose and not self._exiting_via_atexit_handler:
211             os.kill(os.getpid(), signal.SIGTERM)
212 
213     def _handle_vsc_close(self):
214         if self._closed:
215             return
216         self.close()
217
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/ptvsd/daemon.py b/ptvsd/daemon.py
--- a/ptvsd/daemon.py
+++ b/ptvsd/daemon.py
@@ -168,6 +168,9 @@
         self._atexit_handlers.append(handler)
 
     def _add_signal_handlers(self):
+        if platform.system() == 'Windows':
+            return
+
         def handler(signum, frame):
             if not self._closed:
                 self.close()

{"golden_diff": "diff --git a/ptvsd/daemon.py b/ptvsd/daemon.py\n--- a/ptvsd/daemon.py\n+++ b/ptvsd/daemon.py\n@@ -168,6 +168,9 @@\n         self._atexit_handlers.append(handler)\n \n     def _add_signal_handlers(self):\n+        if platform.system() == 'Windows':\n+            return\n+\n         def handler(signum, frame):\n             if not self._closed:\n                 self.close()\n", "issue": "PTVSD fails to run on windows\n```\r\nTraceback (most recent call last):\r\n  File \"C:\\Users\\karth\\.vscode\\extensions\\ms-python.python-2018.3.1\\pythonFiles\\experimental\\ptvsd_launcher.py\", line 96,\r\nin <module>\r\n    vspd.debug(filename, port_num, debug_id, debug_options, run_as)\r\n  File \"c:\\git\\ptvsd\\ptvsd\\debugger.py\", line 36, in debug\r\n    run(address, filename, *args, **kwargs)\r\n  File \"c:\\git\\ptvsd\\ptvsd\\__main__.py\", line 37, in run_file\r\n    run(argv, addr, **kwargs)\r\n  File \"c:\\git\\ptvsd\\ptvsd\\__main__.py\", line 85, in _run\r\n    daemon = _install(_pydevd, addr, **kwargs)\r\n  File \"c:\\git\\ptvsd\\ptvsd\\pydevd_hooks.py\", line 52, in install\r\n    daemon = Daemon(**kwargs)\r\n  File \"c:\\git\\ptvsd\\ptvsd\\daemon.py\", line 53, in __init__\r\n    self.install_exit_handlers()\r\n  File \"c:\\git\\ptvsd\\ptvsd\\daemon.py\", line 91, in install_exit_handlers\r\n    signal.SIGHUP: [],\r\nAttributeError: module 'signal' has no attribute 'SIGHUP'\r\n```\nPTVSD fails to run on windows\n```\r\nTraceback (most recent call last):\r\n  File \"C:\\Users\\karth\\.vscode\\extensions\\ms-python.python-2018.3.1\\pythonFiles\\experimental\\ptvsd_launcher.py\", line 96,\r\nin <module>\r\n    vspd.debug(filename, port_num, debug_id, debug_options, run_as)\r\n  File \"c:\\git\\ptvsd\\ptvsd\\debugger.py\", line 36, in debug\r\n    run(address, filename, *args, **kwargs)\r\n  File \"c:\\git\\ptvsd\\ptvsd\\__main__.py\", line 37, in run_file\r\n    run(argv, addr, **kwargs)\r\n  File \"c:\\git\\ptvsd\\ptvsd\\__main__.py\", line 85, in _run\r\n    daemon = _install(_pydevd, addr, **kwargs)\r\n  File \"c:\\git\\ptvsd\\ptvsd\\pydevd_hooks.py\", line 52, in install\r\n    daemon = Daemon(**kwargs)\r\n  File \"c:\\git\\ptvsd\\ptvsd\\daemon.py\", line 53, in __init__\r\n    self.install_exit_handlers()\r\n  File \"c:\\git\\ptvsd\\ptvsd\\daemon.py\", line 91, in install_exit_handlers\r\n    signal.SIGHUP: [],\r\nAttributeError: module 'signal' has no attribute 'SIGHUP'\r\n```\n", "before_files": [{"content": "import atexit\nimport os\nimport platform\nimport signal\nimport sys\n\nfrom ptvsd import wrapper\nfrom ptvsd.socket import close_socket\n\n\ndef _wait_on_exit():\n    if sys.__stdout__ is not None:\n        try:\n            import msvcrt\n        except ImportError:\n            sys.__stdout__.write('Press Enter to continue . . . ')\n            sys.__stdout__.flush()\n            sys.__stdin__.read(1)\n        else:\n            sys.__stdout__.write('Press any key to continue . . . ')\n            sys.__stdout__.flush()\n            msvcrt.getch()\n\n\nclass DaemonClosedError(RuntimeError):\n    \"\"\"Indicates that a Daemon was unexpectedly closed.\"\"\"\n    def __init__(self, msg='closed'):\n        super(DaemonClosedError, self).__init__(msg)\n\n\nclass Daemon(object):\n    \"\"\"The process-level manager for the VSC protocol debug adapter.\"\"\"\n\n    exitcode = 0\n\n    def __init__(self, wait_on_exit=_wait_on_exit,\n                 addhandlers=True, killonclose=True):\n        self.wait_on_exit = wait_on_exit\n        self.killonclose = killonclose\n\n        self._closed = False\n        self._exiting_via_atexit_handler = False\n\n        self._pydevd = None\n        self._server = None\n        self._client = None\n        self._adapter = None\n\n        self._signal_handlers = None\n        self._atexit_handlers = None\n        self._handlers_installed = False\n        if addhandlers:\n            self.install_exit_handlers()\n\n    @property\n    def pydevd(self):\n        return self._pydevd\n\n    @property\n    def server(self):\n        return self._server\n\n    @property\n    def client(self):\n        return self._client\n\n    @property\n    def adapter(self):\n        return self._adapter\n\n    def start(self, server=None):\n        \"\"\"Return the \"socket\" to use for pydevd after setting it up.\"\"\"\n        if self._closed:\n            raise DaemonClosedError()\n        if self._pydevd is not None:\n            raise RuntimeError('already started')\n        self._pydevd = wrapper.PydevdSocket(\n            self._handle_pydevd_message,\n            self._handle_pydevd_close,\n            self._getpeername,\n            self._getsockname,\n        )\n        self._server = server\n        return self._pydevd\n\n    def install_exit_handlers(self):\n        \"\"\"Set the placeholder handlers.\"\"\"\n        if self._signal_handlers is not None:\n            raise RuntimeError('exit handlers already installed')\n        self._signal_handlers = {\n            signal.SIGHUP: [],\n        }\n        self._atexit_handlers = []\n\n        if platform.system() != 'Windows':\n            try:\n                for sig in self._signal_handlers:\n                    signal.signal(sig, self._signal_handler)\n            except ValueError:\n                # Wasn't called in main thread!\n                raise\n        atexit.register(self._atexit_handler)\n\n    def set_connection(self, client):\n        \"\"\"Set the client socket to use for the debug adapter.\n\n        A VSC message loop is started for the client.\n        \"\"\"\n        if self._closed:\n            raise DaemonClosedError()\n        if self._pydevd is None:\n            raise RuntimeError('not started yet')\n        if self._client is not None:\n            raise RuntimeError('connection already set')\n        self._client = client\n\n        self._adapter = wrapper.VSCodeMessageProcessor(\n            client,\n            self._pydevd.pydevd_notify,\n            self._pydevd.pydevd_request,\n            self._handle_vsc_disconnect,\n            self._handle_vsc_close,\n        )\n        name = 'ptvsd.Client' if self._server is None else 'ptvsd.Server'\n        self._adapter.start(name)\n        if self._signal_handlers is not None:\n            self._add_signal_handlers()\n            self._add_atexit_handler()\n        return self._adapter\n\n    def close(self):\n        \"\"\"Stop all loops and release all resources.\"\"\"\n        if self._closed:\n            raise DaemonClosedError('already closed')\n        self._closed = True\n\n        if self._adapter is not None:\n            normal, abnormal = self._adapter._wait_options()\n            if (normal and not self.exitcode) or (abnormal and self.exitcode):\n                self.wait_on_exit()\n\n        if self._pydevd is not None:\n            close_socket(self._pydevd)\n        if self._client is not None:\n            self._release_connection()\n\n    def re_build_breakpoints(self):\n        self.adapter.re_build_breakpoints()\n\n    # internal methods\n\n    def _signal_handler(self, signum, frame):\n        for handle_signal in self._signal_handlers.get(signum, ()):\n            handle_signal(signum, frame)\n\n    def _atexit_handler(self):\n        for handle_atexit in self._atexit_handlers:\n            handle_atexit()\n\n    def _add_atexit_handler(self):\n        def handler():\n            self._exiting_via_atexit_handler = True\n            if not self._closed:\n                self.close()\n            if self._adapter is not None:\n                # TODO: Do this in VSCodeMessageProcessor.close()?\n                self._adapter._wait_for_server_thread()\n        self._atexit_handlers.append(handler)\n\n    def _add_signal_handlers(self):\n        def handler(signum, frame):\n            if not self._closed:\n                self.close()\n            sys.exit(0)\n        self._signal_handlers[signal.SIGHUP].append(handler)\n\n    def _release_connection(self):\n        if self._adapter is not None:\n            # TODO: This is not correct in the \"attach\" case.\n            self._adapter.handle_pydevd_stopped(self.exitcode)\n            self._adapter.close()\n        close_socket(self._client)\n\n    # internal methods for PyDevdSocket().\n\n    def _handle_pydevd_message(self, cmdid, seq, text):\n        if self._adapter is not None:\n            self._adapter.on_pydevd_event(cmdid, seq, text)\n\n    def _handle_pydevd_close(self):\n        if self._closed:\n            return\n        self.close()\n\n    def _getpeername(self):\n        if self._client is None:\n            raise NotImplementedError\n        return self._client.getpeername()\n\n    def _getsockname(self):\n        if self._client is None:\n            raise NotImplementedError\n        return self._client.getsockname()\n\n    # internal methods for VSCodeMessageProcessor\n\n    def _handle_vsc_disconnect(self, kill=False):\n        if not self._closed:\n            self.close()\n        if kill and self.killonclose and not self._exiting_via_atexit_handler:\n            os.kill(os.getpid(), signal.SIGTERM)\n\n    def _handle_vsc_close(self):\n        if self._closed:\n            return\n        self.close()\n", "path": "ptvsd/daemon.py"}], "after_files": [{"content": "import atexit\nimport os\nimport platform\nimport signal\nimport sys\n\nfrom ptvsd import wrapper\nfrom ptvsd.socket import close_socket\n\n\ndef _wait_on_exit():\n    if sys.__stdout__ is not None:\n        try:\n            import msvcrt\n        except ImportError:\n            sys.__stdout__.write('Press Enter to continue . . . ')\n            sys.__stdout__.flush()\n            sys.__stdin__.read(1)\n        else:\n            sys.__stdout__.write('Press any key to continue . . . ')\n            sys.__stdout__.flush()\n            msvcrt.getch()\n\n\nclass DaemonClosedError(RuntimeError):\n    \"\"\"Indicates that a Daemon was unexpectedly closed.\"\"\"\n    def __init__(self, msg='closed'):\n        super(DaemonClosedError, self).__init__(msg)\n\n\nclass Daemon(object):\n    \"\"\"The process-level manager for the VSC protocol debug adapter.\"\"\"\n\n    exitcode = 0\n\n    def __init__(self, wait_on_exit=_wait_on_exit,\n                 addhandlers=True, killonclose=True):\n        self.wait_on_exit = wait_on_exit\n        self.killonclose = killonclose\n\n        self._closed = False\n        self._exiting_via_atexit_handler = False\n\n        self._pydevd = None\n        self._server = None\n        self._client = None\n        self._adapter = None\n\n        self._signal_handlers = None\n        self._atexit_handlers = None\n        self._handlers_installed = False\n        if addhandlers:\n            self.install_exit_handlers()\n\n    @property\n    def pydevd(self):\n        return self._pydevd\n\n    @property\n    def server(self):\n        return self._server\n\n    @property\n    def client(self):\n        return self._client\n\n    @property\n    def adapter(self):\n        return self._adapter\n\n    def start(self, server=None):\n        \"\"\"Return the \"socket\" to use for pydevd after setting it up.\"\"\"\n        if self._closed:\n            raise DaemonClosedError()\n        if self._pydevd is not None:\n            raise RuntimeError('already started')\n        self._pydevd = wrapper.PydevdSocket(\n            self._handle_pydevd_message,\n            self._handle_pydevd_close,\n            self._getpeername,\n            self._getsockname,\n        )\n        self._server = server\n        return self._pydevd\n\n    def install_exit_handlers(self):\n        \"\"\"Set the placeholder handlers.\"\"\"\n        if self._signal_handlers is not None:\n            raise RuntimeError('exit handlers already installed')\n        self._signal_handlers = {\n            signal.SIGHUP: [],\n        }\n        self._atexit_handlers = []\n\n        if platform.system() != 'Windows':\n            try:\n                for sig in self._signal_handlers:\n                    signal.signal(sig, self._signal_handler)\n            except ValueError:\n                # Wasn't called in main thread!\n                raise\n        atexit.register(self._atexit_handler)\n\n    def set_connection(self, client):\n        \"\"\"Set the client socket to use for the debug adapter.\n\n        A VSC message loop is started for the client.\n        \"\"\"\n        if self._closed:\n            raise DaemonClosedError()\n        if self._pydevd is None:\n            raise RuntimeError('not started yet')\n        if self._client is not None:\n            raise RuntimeError('connection already set')\n        self._client = client\n\n        self._adapter = wrapper.VSCodeMessageProcessor(\n            client,\n            self._pydevd.pydevd_notify,\n            self._pydevd.pydevd_request,\n            self._handle_vsc_disconnect,\n            self._handle_vsc_close,\n        )\n        name = 'ptvsd.Client' if self._server is None else 'ptvsd.Server'\n        self._adapter.start(name)\n        if self._signal_handlers is not None:\n            self._add_signal_handlers()\n            self._add_atexit_handler()\n        return self._adapter\n\n    def close(self):\n        \"\"\"Stop all loops and release all resources.\"\"\"\n        if self._closed:\n            raise DaemonClosedError('already closed')\n        self._closed = True\n\n        if self._adapter is not None:\n            normal, abnormal = self._adapter._wait_options()\n            if (normal and not self.exitcode) or (abnormal and self.exitcode):\n                self.wait_on_exit()\n\n        if self._pydevd is not None:\n            close_socket(self._pydevd)\n        if self._client is not None:\n            self._release_connection()\n\n    def re_build_breakpoints(self):\n        self.adapter.re_build_breakpoints()\n\n    # internal methods\n\n    def _signal_handler(self, signum, frame):\n        for handle_signal in self._signal_handlers.get(signum, ()):\n            handle_signal(signum, frame)\n\n    def _atexit_handler(self):\n        for handle_atexit in self._atexit_handlers:\n            handle_atexit()\n\n    def _add_atexit_handler(self):\n        def handler():\n            self._exiting_via_atexit_handler = True\n            if not self._closed:\n                self.close()\n            if self._adapter is not None:\n                # TODO: Do this in VSCodeMessageProcessor.close()?\n                self._adapter._wait_for_server_thread()\n        self._atexit_handlers.append(handler)\n\n    def _add_signal_handlers(self):\n        if platform.system() == 'Windows':\n            return\n\n        def handler(signum, frame):\n            if not self._closed:\n                self.close()\n            sys.exit(0)\n        self._signal_handlers[signal.SIGHUP].append(handler)\n\n    def _release_connection(self):\n        if self._adapter is not None:\n            # TODO: This is not correct in the \"attach\" case.\n            self._adapter.handle_pydevd_stopped(self.exitcode)\n            self._adapter.close()\n        close_socket(self._client)\n\n    # internal methods for PyDevdSocket().\n\n    def _handle_pydevd_message(self, cmdid, seq, text):\n        if self._adapter is not None:\n            self._adapter.on_pydevd_event(cmdid, seq, text)\n\n    def _handle_pydevd_close(self):\n        if self._closed:\n            return\n        self.close()\n\n    def _getpeername(self):\n        if self._client is None:\n            raise NotImplementedError\n        return self._client.getpeername()\n\n    def _getsockname(self):\n        if self._client is None:\n            raise NotImplementedError\n        return self._client.getsockname()\n\n    # internal methods for VSCodeMessageProcessor\n\n    def _handle_vsc_disconnect(self, kill=False):\n        if not self._closed:\n            self.close()\n        if kill and self.killonclose and not self._exiting_via_atexit_handler:\n            os.kill(os.getpid(), signal.SIGTERM)\n\n    def _handle_vsc_close(self):\n        if self._closed:\n            return\n        self.close()\n", "path": "ptvsd/daemon.py"}]}