networking improvements

This commit is contained in:
kepler155c@gmail.com
2017-05-10 06:11:25 -04:00
parent f866d2bd58
commit 3a922ad2f4
10 changed files with 97 additions and 57 deletions

View File

@@ -71,6 +71,19 @@ function socketClass:write(data)
return true
end
function socketClass:ping()
if not self.connected then
Logger.log('socket', 'ping: No connection')
return false
end
transport.write(self, {
type = 'PING',
seq = self.wseq,
data = data,
})
return true
end
function socketClass:close()
if self.connected then
Logger.log('socket', 'closing socket ' .. self.sport)