#if !BESTHTTP_DISABLE_SIGNALR using System; using BestHTTP.SignalR.Hubs; namespace BestHTTP.SignalR.Messages { /// /// This struct represents a message from the client. /// It holds every data and reference needed to construct the string represented message that will be sent to the wire. /// public struct ClientMessage { /// /// Reference to the source Hub. The Name and the State of the hub will be user. /// public readonly Hub Hub; /// /// Name of the method on the server to be called. /// public readonly string Method; /// /// Arguments of the method. /// public readonly object[] Args; /// /// Unique id on the client of this message /// public readonly UInt64 CallIdx; /// /// The delegate that will be called when the server will sends a result of this method call. /// public readonly OnMethodResultDelegate ResultCallback; /// /// The delegate that will be called when the server sends an error-result to this method call. /// public readonly OnMethodFailedDelegate ResultErrorCallback; /// /// The delegate that will be called when the server sends a progress message to this method call. /// public readonly OnMethodProgressDelegate ProgressCallback; public ClientMessage(Hub hub, string method, object[] args, UInt64 callIdx, OnMethodResultDelegate resultCallback, OnMethodFailedDelegate resultErrorCallback, OnMethodProgressDelegate progressCallback) { Hub = hub; Method = method; Args = args; CallIdx = callIdx; ResultCallback = resultCallback; ResultErrorCallback = resultErrorCallback; ProgressCallback = progressCallback; } } } #endif