some time ago I wanted to understand how I could possibly program a local multiplayer for a game. I wanted to learn everything from binoculars, so I decided to use only the Lua socket library. To represent the functions, I decided to program a simple chat between two computers. I used the UDP protocol and programmed the broadcasting, so the peers will automatically establish a connection.
I think it can help a lot for anyone who would like to learn how everything works. So here it is.
p2p.zip (6.9 MB)
p2p - Windows example.zip (9.4 MB)
And here video for visualization: