예제 #1
0
 public BackOff(WebSocketHost host, int min = 500, int?max = null)
 {
     this.min          = min;
     this.max          = max ?? min * 10;
     this.host         = host;
     this.m_Current    = min;
     this.m_CallbackId = -1;
     this.m_Fails      = 0;
 }
예제 #2
0
        public SocketGateway(WebSocketHost host)
        {
            if (m_Instance != null)
            {
                DebugerUtils.DebugAssert(false, "fatal error: duplicated socket gateways is not allowed!");
                return;
            }

            m_Instance  = this;
            this.m_Host = host;

            this.m_CandidateURLs  = new List <string>();
            this.m_CandidateIndex = 0;
            this.m_PayloadQueue   = new List <string>();
            this.m_BackOff        = new BackOff(host, 1000, 30000);
            this.m_CommitId       = null;
            this.m_Socket         = null;

            this._Reset(isInit: true);
        }
예제 #3
0
 public WebSocket(WebSocketHost host, bool useSslHandShakeHack)
 {
     this.m_State = WebSocketState.NotConnected;
     this.m_Host  = host;
     this.m_useSslHandShakeHack = useSslHandShakeHack;
 }