FastBinaryEncoding icon indicating copy to clipboard operation
FastBinaryEncoding copied to clipboard

Missing documentation for Message

Open bmezhibovskiy opened this issue 2 years ago • 2 comments

In the proto.fbe example, the last three objects are of type "message", but that type is not found in the README or in the spec.

bmezhibovskiy avatar Feb 17 '23 18:02 bmezhibovskiy

Yes, spec should be updated with messages, requests and responses. Briefly message is a root struct for RPC (generated sender, receiver and client). Message could be request, response, reject and notification. For each request it is possible to declare one corresponding response and one or more rejects:

// Domain declaration
domain com.chronoxor

// Package declaration
package simple

// Protocol version
version 1.0

// Simple request message
[request]
[response(SimpleResponse)]
[reject(SimpleReject)]
message SimpleRequest
{
    // Request Id
    uuid [id] = uuid1;
    // Request message
    string Message;
}

// Simple response
message SimpleResponse
{
    // Response Id
    uuid [id] = uuid1;
    // Calculated message length
    uint32 Length;
    // Calculated message hash
    uint32 Hash;
}

// Simple reject
message SimpleReject
{
    // Reject Id
    uuid [id] = uuid1;
    // Error message
    string Error;
}

// Simple notification
message SimpleNotify
{
    // Server notification
    string Notification;
}

// Disconnect request message
[request]
message DisconnectRequest
{
    // Request Id
    uuid [id] = uuid1;
}

chronoxor avatar Feb 17 '23 18:02 chronoxor

C++ generated protocol with server & client examples

C# generated protocol with server & client examples

chronoxor avatar Feb 17 '23 18:02 chronoxor