-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix extension_tool: lunar_log.lua & cocos_cp_class.lua bug
- Loading branch information
Showing
2 changed files
with
9 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
local ds = net.udpCreate(1) | ||
local ds = util.newUdpSocket(1) | ||
|
||
local port = 9966 | ||
if net.udpBind(ds, "", port) then | ||
if ds:bind("", port) then | ||
print(string.format("Recv log on port %d start:\n", port)) | ||
while true do | ||
local len = net.udpRecvFrom(ds) | ||
local len = ds:recvFrom() | ||
if len > 0 then | ||
print(memory.tostring(net.udpGetRecvBuf(ds))) | ||
print(util.memToString(ds:getRecvBuf(ds))) | ||
else | ||
break | ||
end | ||
end | ||
end | ||
|
||
net.udpDestroy(ds) | ||
ds:close() | ||
ds:delete() | ||
|
||
print(string.format("Recv log on port %d end.", port)) | ||
print(string.format("Recv log on port %d end.", port)) |