Skip to content

Commit 3c69b6a

Browse files
committed
add tcp/udp overload annotations for unix sockets
1 parent bc3842c commit 3c69b6a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

meta/3rd/OpenResty/library/ngx.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2697,9 +2697,10 @@ local udpsock = {}
26972697
--- Calling this method on an already connected socket object will cause the original connection to be closed first.
26982698
---
26992699
---@param host string
2700-
---@param port? number
2700+
---@param port number
27012701
---@return boolean ok
27022702
---@return string? error
2703+
---@overload fun(self:udpsock, unix_socket:string):boolean, string?
27032704
function udpsock:setpeername(host, port) end
27042705

27052706
--- Sends data on the current UDP or datagram unix domain socket object.
@@ -2857,10 +2858,11 @@ local tcpsock = {}
28572858
--- Calling this method on an already connected socket object will cause the original connection to be closed first.
28582859
---
28592860
---@param host string
2860-
---@param port? number
2861+
---@param port number
28612862
---@param opts? tcpsock.connect.opts
28622863
---@return boolean ok
28632864
---@return string? error
2865+
---@overload fun(self:tcpsock, unix_socket:string, opts?:tcpsock.connect.opts):boolean, string?
28642866
function tcpsock:connect(host, port, opts) end
28652867

28662868
--- An optional Lua table can be specified as the last argument to `tcpsock:connect()`

0 commit comments

Comments
 (0)