Skip to content
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

Merged
merged 1 commit into from
Oct 6, 2023
Merged

Fix #1337: Get port info from debugpy #1404

merged 1 commit into from
Oct 6, 2023

Conversation

int19h
Copy link
Contributor

@int19h int19h commented Oct 3, 2023

Send "debugpySockets" event with information about opened sockets when clients connect and whenever ports get opened or closed.

Send "debugpySockets" event with information about opened sockets when clients connect and whenever ports get opened or closed.
@sonarcloud
Copy link

sonarcloud bot commented Oct 3, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

94.1% 94.1% Coverage
0.0% 0.0% Duplication

Copy link
Member

@AdamYoblick AdamYoblick left a 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]
Copy link
Member

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?

Copy link
Contributor Author

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 = [
Copy link
Member

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?

@int19h int19h merged commit ef9a67f into microsoft:main Oct 6, 2023
26 checks passed
@int19h int19h deleted the 1337 branch October 6, 2023 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants