-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #1337: Get port info from debugpy #1404
Conversation
Send "debugpySockets" event with information about opened sockets when clients connect and whenever ports get opened or closed.
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved with some questions :)
"port": port, | ||
"internal": listener is not clients.listener, | ||
} | ||
for listener in [clients.listener, launchers.listener, servers.listener] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's going on with the lack of indenting in this for loop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a Python list comprehension. C# equivalent would be something like:
from listener in ...
where listener is ...
let (host, port) = listener.getsockname()
select {...}
.ToList()
@@ -701,6 +702,24 @@ def disconnect_request(self, request): | |||
def disconnect(self): | |||
super().disconnect() | |||
|
|||
def report_sockets(self): | |||
sockets = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not familiar with this list initialization syntax. Is there supposed to be a comma after the dict? Does the code afterwards resolve to a list and it gets stuffed into the sockets parent list?
Send "debugpySockets" event with information about opened sockets when clients connect and whenever ports get opened or closed.