moonbridge
diff helloworld.lua @ 127:37532927dba9
Introduced new proto "main" to allow for a main thread
| author | jbe |
|---|---|
| date | Tue Apr 14 19:30:53 2015 +0200 (2015-04-14) |
| parents | d9cc81641175 |
| children | ee98e12427a9 |
line diff
1.1 --- a/helloworld.lua Tue Apr 14 18:20:39 2015 +0200 1.2 +++ b/helloworld.lua Tue Apr 14 19:30:53 2015 +0200 1.3 @@ -6,6 +6,13 @@ 1.4 local http = require "moonbridge_http" 1.5 1.6 listen{ 1.7 + { proto = "main" }, 1.8 + connect = function() 1.9 + print("Main function executed") 1.10 + end 1.11 +} 1.12 + 1.13 +listen{ 1.14 { proto = "tcp", host = "127.0.0.1", port = 8080 }, -- IPv4 1.15 { proto = "tcp", host = "::1", port = 8080 }, -- IPv6 1.16 connect = http.generate_handler(