コード例 #1
0
ファイル: Saferize.cs プロジェクト: renatost/unity-sdk
 public Saferize(String privateKey, String saferizeUrl, String websocketUrl, String apiKey)
 {
     connection             = new SaferizeConnection(privateKey, saferizeUrl, apiKey);
     this.websocketUrl      = websocketUrl;
     this.reconnectTryCount = 0;
     this.maxRetryCount     = 10;
     this.connectionState   = OnlineStatusEnum.UNKNOWN;
 }
コード例 #2
0
        public WebSocketClient(String websocketUrl, SaferizeConnection saferizeConnection)
        {
            this.webSockerUrl       = websocketUrl;
            this.saferizeConnection = saferizeConnection;
            _socket               = new WebSocket(webSockerUrl);
            _socket.EmitOnPing    = true;
            _socket.CustomHeaders = new Dictionary <string, string> {
                { "Authorization", "Bearer " + saferizeConnection.GetJWTSignature() },
            };

            maxPingResponseWaitTime = 5;
            timer = new Timer(checkSocketState, this, maxPingResponseWaitTime * 1000, maxPingResponseWaitTime * 1000);
        }