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

Support Socket Listen when debugging Remote Java Application #415

Open
testforstephen opened this issue Sep 10, 2018 · 8 comments
Open

Support Socket Listen when debugging Remote Java Application #415

testforstephen opened this issue Sep 10, 2018 · 8 comments

Comments

@testforstephen
Copy link
Contributor

testforstephen commented Sep 10, 2018

The original request is from @krisrice.

Currently Java debugger supports Socket Attach by default when debugging remote Java application, the new feature request is to support Socket Listen for remote debugging.

@krisrice
Copy link

In eclipse, there are 2 options Socket Attach and Socket Listen. Right now vscode-java-debug only support the Attach option.

The Standard (Socket Listen) connection type creates a launch that will listen for incoming connections from a remote VM.

@HughDevlin
Copy link

If I understand the above comments correctly, remote debugging using vscode-java-debug currently requires the remote jvm debuggee be started with the jwdp agent with parameter "server=n"
In other words, the only way java debug attach currently works is with vscode acting as the jwdp server and the debuggee acting as the jwdp client, this puts the onus on the debuggee jwdp agent to initiate the debugging session with vscode-java-debug, which implies that the vscode workstation IP address must be specified in the jwdp agent address parameter, and that the vscode workstation open its firewall to the specified debugging port, which is important to know.
Is this correct? thanks

@testforstephen
Copy link
Contributor Author

If I understand the above comments correctly, remote debugging using vscode-java-debug currently requires the remote jvm debuggee be started with the jwdp agent with parameter "server=n"

No, currently you need start your debuggee agent with "server=y" before attach. The first one to start is server, then the client can connect to it.

@HughDevlin
Copy link

thank you four your reply
ok, so the debuggee must be the server and must be started first
so, the debugging port specified on the jwdp agent must be open on the debuggee machine in order to accept the client (debugger) connection
Is this correct? thanks again

@testforstephen
Copy link
Contributor Author

the debugging port specified on the jwdp agent must be open on the debuggee machine in order to accept the client (debugger) connection

Correct.

@Marshal27
Copy link

Having to switch to IntelliJ as this feature is unfortunately still not available.

@testforstephen
Copy link
Contributor Author

testforstephen commented Jan 26, 2024

I’m trying to find out how common it is to use “Socket Listen”. What are some scenarios where you would use “Socket Listen” instead of “Socket Attach”?

@Marshal27
Copy link

My current employer utilizes development sandboxes that are dynamically created in Linux environments through a homegrown work request system. Once a sandbox has been created via a work request, it is accessed through a launcher interface to initiate the UI. One of the optional fields is used to define the DNS entry for JD, instructing the sandbox to connect to the developer's listening debugger port.

I assume this decision was made to prevent the proliferation of development sandboxes with open ports actively listening for incoming debugger connections, potentially reaching dozens—if not hundreds. This approach aims to make debugger interactions more intentional, mitigating the risk of unintentional connections or interruptions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants