Skip to content

Conversation

@britzl
Copy link
Collaborator

@britzl britzl commented Aug 14, 2025

Added function to disconnect a previously connected socket:

-- create socket
local socket = client.create_socket()

-- connect socket
local ok, err = socket.connect()
if not ok then
    return
end

-- disconnect socket
socket.disconnect()

Fix #84

@britzl britzl requested review from DannyIsYog and novabyte August 14, 2025 07:37
local socket = client.create_socket()

socket.disconnect()
assert_true(true)

Choose a reason for hiding this comment

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

This assert will always pass, is this intended? Isn't there a better way to assert if the sockets was indeed disconnected?

Like:

assert_nil(socket.connection)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point. Let me take a look.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@DannyIsYog I've updated the test with a better assert. Could you please take another look?

@britzl britzl requested review from DannyIsYog and removed request for novabyte August 27, 2025 07:15
Copy link

@DannyIsYog DannyIsYog left a comment

Choose a reason for hiding this comment

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

Looks good!

@britzl britzl merged commit dd0e9b2 into master Aug 27, 2025
3 checks passed
@britzl britzl deleted the fix-84-socket-disconnect branch August 27, 2025 11:03
@britzl
Copy link
Collaborator Author

britzl commented Aug 27, 2025

Thanks. @DannyIsYog what does is the correct release process for this repository when there are external collaborators such as myself? I am able to create a new release, but I also need to update the changelog to assign the unreleased changes to a release prior to actually making the release itself. Do I first create a separate PR with the changelog update and then do the release?

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.

Can't disconnect socket

3 participants