Thoughts about ctrl close
This commit is contained in:
parent
e914ec3fa2
commit
e3292deb15
|
@ -127,9 +127,15 @@ class TeeworldsClient
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# TODO: this is same in client and server
|
||||||
|
# move to NetBase???
|
||||||
|
def send_ctrl_close
|
||||||
|
@netbase&.send_packet([NET_CTRLMSG_CLOSE], 0, control: true)
|
||||||
|
end
|
||||||
|
|
||||||
def disconnect
|
def disconnect
|
||||||
puts 'disconnecting.'
|
puts 'disconnecting.'
|
||||||
@netbase&.send_packet([NET_CTRLMSG_CLOSE], 0, control: true)
|
send_ctrl_close
|
||||||
@s&.close
|
@s&.close
|
||||||
@signal_disconnect = true
|
@signal_disconnect = true
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue