change source dir

This commit is contained in:
云风
2012-08-09 15:36:56 +08:00
parent d23c4aa905
commit eed9c42fd4
46 changed files with 284 additions and 118 deletions

25
service/testconn.lua Normal file
View File

@@ -0,0 +1,25 @@
local skynet = require "skynet"
-- register a dummy callback function
skynet.dispatch()
local connection = skynet.launch("connection","16")
print("connection",connection)
skynet.start(function()
local fd = skynet.call(".connection","CONNECT 127.0.0.1:8000")
if fd == nil then
print("Connect failed")
skynet.exit()
return
end
print("connect to ",fd)
skynet.send(".connection","WRITE "..fd.." Welcome\n")
local four = skynet.call(".connection","READ "..fd .." 4")
print("READ 4", four)
local line = skynet.call(".connection","READLINE "..fd .." \n")
skynet.send(".connection","WRITE "..fd.." "..line.."\n")
skynet.send(".connection","CLOSE "..fd)
skynet.exit()
end)