cocoserve
Cocoserve is a simple websocket server framework written by C.
It aims at receiving 10,000 - 100,000 concurrent accesses.
You can create websocket server within event driven mechanism.
Cocoserve is a simple websocket server framework written by C.
It aims at receiving 10,000 - 100,000 concurrent accesses.
You can create websocket server within event driven mechanism.
members = {}; function on_connect(client) for i=1,#members do members[i]:send("Came! ("..(#members+1)..")"); end members[#members+1] = client; client:send("Hello! ("..#members..")"); return true; end function on_data(client, arrived) for i=1,#members do members[i]:send(arrived); end return true; end function on_close(client, arrived) local t; for i=1,#members do if members[i] == client then t = i; else members[i]:send("leaved... ("..(#members-1)..")"); end end table.remove(members, t); end