Skip to content

Instantly share code, notes, and snippets.

View GlasFrost's full-sized avatar

Luis Hartmann GlasFrost

View GitHub Profile
@d33tah
d33tah / chat.lua
Created June 28, 2013 22:25
A sketch of a chat service implemented in Lua.
#!/usr/bin/lua
peers = {}
peer_names = {}
reverse_peers = {}
function on_connect(sock)
local idx = #peers+1
local newname = string.format("Peer%d", idx)
peers[idx] = sock