vscode-java-debug
vscode-java-debug copied to clipboard
Support Socket Listen when debugging Remote Java Application
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.
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.
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
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.
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
the debugging port specified on the jwdp agent must be open on the debuggee machine in order to accept the client (debugger) connection
Correct.
Having to switch to IntelliJ
as this feature is unfortunately still not available.
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”?
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.