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; }
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); }