+ if msg then
+ socket:send( msg .. "\r\n" )
+ end
+
+ socket:close()
+end
+
+function Server.error500(self, socket, msg)
+ socket:send( "HTTP/1.0 500 Internal Server Error\r\n" )
+ socket:send( "Content-Type: text/plain\r\n\r\n" )
+
+ if msg then
+ socket:send( msg .. "\r\n" )
+ end
+
+ socket:close()
+end
+
+function Server.error503(self, socket)
+ socket:send( "HTTP/1.0 503 Server unavailable\r\n" )
+ socket:send( "Content-Type: text/plain\r\n\r\n" )
+ socket:send( "There are too many clients connected, try again later\r\n" )
+ socket:close()
+end