From 3c69b6ae9aa021d94a62db18b6447e64487bebce Mon Sep 17 00:00:00 2001 From: Michael Martin <3277009+flrgh@users.noreply.github.com> Date: Mon, 9 May 2022 09:58:58 -0700 Subject: add tcp/udp overload annotations for unix sockets --- meta/3rd/OpenResty/library/ngx.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'meta/3rd/OpenResty/library/ngx.lua') diff --git a/meta/3rd/OpenResty/library/ngx.lua b/meta/3rd/OpenResty/library/ngx.lua index d3cf8c6b..a607545a 100644 --- a/meta/3rd/OpenResty/library/ngx.lua +++ b/meta/3rd/OpenResty/library/ngx.lua @@ -2697,9 +2697,10 @@ local udpsock = {} --- Calling this method on an already connected socket object will cause the original connection to be closed first. --- ---@param host string ----@param port? number +---@param port number ---@return boolean ok ---@return string? error +---@overload fun(self:udpsock, unix_socket:string):boolean, string? function udpsock:setpeername(host, port) end --- Sends data on the current UDP or datagram unix domain socket object. @@ -2857,10 +2858,11 @@ local tcpsock = {} --- Calling this method on an already connected socket object will cause the original connection to be closed first. --- ---@param host string ----@param port? number +---@param port number ---@param opts? tcpsock.connect.opts ---@return boolean ok ---@return string? error +---@overload fun(self:tcpsock, unix_socket:string, opts?:tcpsock.connect.opts):boolean, string? function tcpsock:connect(host, port, opts) end --- An optional Lua table can be specified as the last argument to `tcpsock:connect()` -- cgit v1.2.3