Skip to content

fix: allow quick restart in Linux#317

Merged
actboy168 merged 1 commit intoactboy168:masterfrom
vworlds:allow-quick-restart
Apr 8, 2025
Merged

fix: allow quick restart in Linux#317
actboy168 merged 1 commit intoactboy168:masterfrom
vworlds:allow-quick-restart

Conversation

@jpeletier
Copy link
Copy Markdown
Contributor

On Linux, I’ve encountered an issue where terminating the host application leaves the debugger’s listening socket in the TIME_WAIT state. This prevents the debugger from rebinding to the same address upon restarting the application.

During active debugging sessions, frequent restarts are common after identifying issues. However, because the socket remains in TIME_WAIT, the debugger fails to bind again, reporting the address as already in use. This forces the user to wait for the OS to release the socket before continuing.

This PR addresses the problem by enabling the SO_REUSEADDR socket option, allowing the debugger to rebind to the same address immediately after a restart.

Comment on lines +122 to +127
fds[1] = server
if session ~= nil then
session:close()
fds[2] = session
end
server:close()
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do these changes do?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is optional. Just conceptually, clossing the session before shutting down the server.

@actboy168 actboy168 merged commit a37fecf into actboy168:master Apr 8, 2025
6 checks passed
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