add socket:available() --> int

This commit is contained in:
MihailRis
2025-01-07 18:44:40 +03:00
parent e94b70fd3a
commit 13de581b4b
5 changed files with 17 additions and 0 deletions
+1
View File
@@ -40,6 +40,7 @@ local Socket = {__index={
send=function(self, ...) return network.__send(self.id, ...) end,
recv=function(self, ...) return network.__recv(self.id, ...) end,
close=function(self) return network.__close(self.id) end,
available=function(self) return network.__available(self.id) or 0 end,
is_alive=function(self) return network.__is_alive(self.id) end,
is_connected=function(self) return network.__is_connected(self.id) end,
get_address=function(self) return network.__get_address(self.id) end,
+1
View File
@@ -424,6 +424,7 @@ function __vc_resume_coroutine(id)
if co then
coroutine.resume(co)
if __vc_coroutine_error then
debug.error(__vc_coroutine_error)
error(__vc_coroutine_error)
end
return coroutine.status(co) ~= "dead"