Skip to content

[Optimizations] Better way to avoid allocations? #65

Description

@sebas77

I am not sure yet that what I am doing here is what the lib expects me to do, but if so, it seems a waste allocation wise (games, unity)

 while (_textSenderQueue.TryDequeue(out var buffer))
                {
                    var writer = _socket.CreateMessageWriter(vtortola.WebSockets.WebSocketMessageType.Text);

                    await writer.WriteAsync(buffer, _cancellationToken);
                    await writer.CloseAsync();
                }

any advise?

Also this code works fine on pc, but on mobile there is a big lag not sure why

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions