Team XSockets.NET

Alias for controllers/methods

It is probably good from a developers point of view to name the controllers and methods something that make sense ;). But long names will mean more data to pass back and forth between server(s) and client(s). Therefor you can give the controllers and methods an alias to that will be used in communication to save some bytes.

Changing the controller name

This is done by adding the XSocketMetadata attribute. Below we give the LongFooControllerName the alias of foo.

using XSockets.Plugin.Framework.Attributes;

[XSocketMetadata("foo")]
public class LongFooControllerName : XSocketController
{ 
    //code removed for readability   
}

Changing the method name

This is done by adding the ControllerEvent attribute. Below we give the LongBarMethodName the alias of bar.

using XSockets.Core.Common.Socket.Event.Attributes;

//code removed for readability   

[ControllerEvent("bar")]
public async Task LongBarMethodName(string s)
{
    //code removed for readability   
}

This method will be invoked if you use the topic bar

results matching ""

    No results matching ""