require'eventmachine'classEmConnection<EventMachine::Connectiondefself.❨╯°□°❩╯︵┻━┻puts"Calm down, yo."end# 打开链接时 callbackdefopen_connp'open it !'end# TODO 心跳发送数据包defsend_tckself.send_data('你的心跳数据格式')endendEM.epoll??EM.epoll:EM.kqueueEM.run{@connection=EM.connect('你的socket链接地址','端口',EmConnection)EM.add_periodic_timer(3){@connection.send_tck}EM.error_handler{|e|pe.message}}
9 Floor has deleted
You need to Sign in before reply, if you don't have an account, please Sign up first.