Forward server working on Mac OS X...
This commit is contained in:
parent
5d32848674
commit
8d4e240f6a
29 changed files with 800 additions and 101 deletions
17
test/utestsrvr.lua
Normal file
17
test/utestsrvr.lua
Normal file
|
@ -0,0 +1,17 @@
|
|||
require("socket");
|
||||
os.remove("/tmp/luasocket")
|
||||
socket = require("socket.unix");
|
||||
host = "luasocket";
|
||||
server = socket.unix()
|
||||
print(server:bind(host))
|
||||
print(server:listen(5))
|
||||
ack = "\n";
|
||||
while 1 do
|
||||
print("server: waiting for client connection...");
|
||||
control = assert(server:accept());
|
||||
while 1 do
|
||||
command = assert(control:receive());
|
||||
assert(control:send(ack));
|
||||
(loadstring(command))();
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue