Skip to content

Commit 9307118

Browse files
committed
Added socket.disconnect
1 parent 90804a1 commit 9307118

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## [Unreleased]
99

10+
### Added
11+
- Added `socket.disconnect()`
12+
1013
## [3.3.0] - 2024-06-14
1114
### Fixed
1215
- Fixed issue with wrong argument name for `nakama.rpc_func`

nakama/socket.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ function M.connect(socket, callback)
9191
end
9292

9393

94+
--- Disconnect a Nakama socket from the server.
95+
-- @param socket The client socket to disconnect (from call to create_socket).
96+
function M.disconnect(socket)
97+
assert(socket, "You must provide a socket")
98+
socket.engine.socket_disconnect(socket)
99+
end
100+
101+
94102
--- Send message on Nakama socket.
95103
-- @param socket The client socket to use when sending the message.
96104
-- @param message The message string.

0 commit comments

Comments
 (0)