Skip to content

Support for connecting and writing span of bytes #577

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

popcron
Copy link

@popcron popcron commented May 16, 2025

the availability of span overloads is great and really useful. there was just a few missing API that i need for my work:

  • connecting with a span of bytes (2b0d8c0)
Span<byte> connectionData = stackalloc byte[32];
//write data into connectionData manually
NetManager client = new();
client.Start();
client.Connect("localhost", 1337, connectionData);
  • putting a span of bytes into a NetDataWriter (2eb2cbe)
Span<byte> messageData = stackalloc byte[32];
NetDataWriter netWriter = new();
netWriter.Put(messageData);
netPeer.Send(netWriter, DeliveryMethod.ReliableOrdered);

tests were also added to check sanity check both under the NET5_0_OR_GREATER flags

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant