mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add socket:is_alive, :is_connected, serversocket:is_open
This commit is contained in:
parent
34974c4bb3
commit
951d2fd1f8
2 changed files with 36 additions and 2 deletions
|
|
@ -37,9 +37,11 @@ end
|
|||
|
||||
|
||||
local Socket = {__index={
|
||||
send=function(self, bytes) return network.__send(self.id, bytes) end,
|
||||
recv=function(self, len, usetable) return network.__recv(self.id, len, usetable) end,
|
||||
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,
|
||||
is_alive=function(self) return network.__is_alive(self.id) end,
|
||||
is_connected=function(self) return network.__is_connected(self.id) end,
|
||||
}}
|
||||
|
||||
network.tcp_connect = function(address, port, callback)
|
||||
|
|
@ -52,6 +54,7 @@ end
|
|||
|
||||
local ServerSocket = {__index={
|
||||
close=function(self) return network.__closeserver(self.id) end,
|
||||
is_open=function(self) return network.__is_serveropen(self.id) end,
|
||||
}}
|
||||
|
||||
network.tcp_open = function(port, handler)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue