Skip to content

How to send data with tag, serialization, class? #48

Discussion options

You must be logged in to vote

Yes it's possible! Use Byter is included in Netly project (no need external install)

e.g. (Byter and Netly Event) = 💯 + 😄

using Byter;

// create writer
Writer w = new Writer();
w.Add((int)1234567890); // tag
w.Add((string)"Alecio"); // user
w.Add((string)"Alecio123"); // password
byte[] BYTER_BUFFER = w.GetBytes();
// send data
client.ToEvent("my login event", BYTER_BUFFER);

// receive data
client.OnEvent((string name, byte[] data) =>
{
    if (name == "my login event")
   {
        Reader r = new Reader(data);
        string tag = r.Read<string>();
        string user = r.Read<string>();
        string password = r.Read<string>();
        
        // check is it's sucess, if false mean…

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@vanhaodev
Comment options

@alec1o
Comment options

@alec1o
Comment options

@nvh2001
Comment options

@alec1o
Comment options

Answer selected by nvh2001
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants