Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Assets/Samples/Stream Video & Audio Chat SDK/0.8.20.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ private void TryToReconnect()
return;
}

// StreamTODO: revise this. The wrapper state should be perfectly in sync with the inner WebSocket
// Most likely this class should fully rely on WS state and not maintain it's own state
// This check should be handled already by the ConnectionState.IsValidToConnect() above
if (WebsocketClient != null && (WebsocketClient.IsConnecting || WebsocketClient.IsConnected))
{
return;
}

#if STREAM_DEBUG_ENABLED
Logs.Info($"{GetType()} TryToReconnect");
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public interface IWebsocketClient : IDisposable

int ReceiveQueueCount { get; }
int SendQueueCount { get; }
bool IsConnected { get; }
bool IsConnecting { get; }

bool TryDequeueMessage(out byte[] message);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Net.WebSockets;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using NativeWebSocket;
Expand All @@ -23,6 +22,8 @@ public class NativeWebSocketWrapper : IWebsocketClient

public int ReceiveQueueCount => _messages.Count;
public int SendQueueCount => throw new NotImplementedException();
public bool IsConnected => _webSocket.State == WebSocketState.Open;
public bool IsConnecting => _webSocket.State == WebSocketState.Connecting;

public NativeWebSocketWrapper(ILogs logs, bool isDebugMode)
{
Expand Down
Loading