summaryrefslogtreecommitdiff
path: root/xmake/core/base/socket.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/core/base/socket.lua')
-rw-r--r--xmake/core/base/socket.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/xmake/core/base/socket.lua b/xmake/core/base/socket.lua
index b9da2e99a..12b3661f5 100644
--- a/xmake/core/base/socket.lua
+++ b/xmake/core/base/socket.lua
@@ -676,7 +676,7 @@ end
-- tostring(socket)
function _instance:__tostring()
- local rawfd = self:rawfd() or "closed"
+ local rawfd = self:cdata() and self:rawfd() or "closed"
local types = {"tcp", "udp", "icmp"}
return string.format("<socket: %s%s/%s>", types[self:type()], self:family() == socket.IPV6 and "6" or "4", rawfd)
end