提交 e8e6937d 编写于 作者: J Javan Makhmali

Add delay before reopening

上级 e0797271
# Encapsulate the cable connection held by the consumer. This is an internal class not intended for direct user manipulation.
class Cable.Connection
@reopenDelay: 500
constructor: (@consumer) ->
@open()
......@@ -22,8 +24,13 @@ class Cable.Connection
@webSocket?.close()
reopen: ->
@close()
@open()
if @isState("closed")
@open()
else
try
@close()
finally
setTimeout(@open, @constructor.reopenDelay)
isOpen: ->
@isState("open")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册