mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-22 02:53:09 +00:00
bugfix: don't use string.format to concat binary string
This commit is contained in:
@@ -8,10 +8,9 @@ local fd = assert(socket.connect("127.0.0.1", 8888))
|
||||
|
||||
local function send_package(fd, pack)
|
||||
local size = #pack
|
||||
local package = string.format("%c%c%s",
|
||||
bit32.extract(size,8,8),
|
||||
bit32.extract(size,0,8),
|
||||
pack)
|
||||
local package = string.char(bit32.extract(size,8,8)) ..
|
||||
string.char(bit32.extract(size,0,8))..
|
||||
pack
|
||||
|
||||
socket.send(fd, package)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user