From 66aedfd65cff3494b70e8072646094479e3bfed8 Mon Sep 17 00:00:00 2001 From: ame Date: Mon, 8 Jun 2026 22:43:05 -0500 Subject: net util --- docs/net/listen.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'docs/net') diff --git a/docs/net/listen.md b/docs/net/listen.md index 39b0f95..420a609 100644 --- a/docs/net/listen.md +++ b/docs/net/listen.md @@ -118,6 +118,8 @@ res:send("

hello world

") functionaly identical to res:write and res:close +sets res.open to false + #### res:close res:close() @@ -128,6 +130,8 @@ this will still run any selected functions! this is called automatically when there are no more function +sets res.open to false + #### res:stop res:stop() @@ -174,6 +178,25 @@ options table res:sendfile("./html/index.html") ``` +sets res.open to false + +### res:error + +res:error(code) + +sends an error message to the client + +```lua +res:error(404) + +-- HTTP/1.1 404 Not Found +-- ... +-- +-- not found +``` + +sets res.open to false + ### res:upgrade res:upgrade() @@ -197,6 +220,10 @@ res:write** - sends data as an incomplete frame res:sendfile** - sends file to the client res:close** - same function +### res.open + +boolean determining if the connection has been closed via res:send or res:close + ### req.parameters a list of parematers for the current function -- cgit v1.2.3