diff options
author | chai <chaifix@163.com> | 2018-08-14 09:26:22 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-08-14 09:26:22 +0800 |
commit | 5162f84be0a4deb447c6ba1226722b049335d525 (patch) | |
tree | 5f7ed0ddc05b1499eaf0607b88fd5cb5e2a961c1 /bin/client/main.lua | |
parent | 636e766791dc8680d237fafe4ff6dd904e16a860 (diff) |
*update
Diffstat (limited to 'bin/client/main.lua')
-rw-r--r-- | bin/client/main.lua | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/bin/client/main.lua b/bin/client/main.lua index df33e21..65fb6aa 100644 --- a/bin/client/main.lua +++ b/bin/client/main.lua @@ -5,19 +5,18 @@ local asynReceive = [[ io.stdout:setvbuf("no") local thread = jin.thread.getThread() local socket = thread:demand(1) +local buf = nil while true do - -- local sendBuf = thread:demand(3) - -- socket:send(sendBuf) - local buf = socket:receive() + buf = socket:receive() thread:send(2, buf) end ]] -local x = 30 -local y = 30 + jin.core.onLoad = function() - thread = jin.thread.Thread("asynReceive", asynReceive) jin.net.init() socket = jin.net.Socket("TCP", "127.0.0.1", 8809) + + thread = jin.thread.Thread("asynReceive", asynReceive) thread:start() thread:send(1, socket) end @@ -30,7 +29,8 @@ jin.core.onEvent = function(e) end end end -local i = 0 +local x = 0 +local y = 0 jin.core.onUpdate = function(dt) if thread:receive(2) then local buf = thread:fetch(2) |