diff options
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) |