TsgcWSPServer_sgc

This is Server Protocol Default Component, you need to drop this component in the form and select a TsgcWebSocketServer Component using Server Property.

 

Methods

   Subscribe / UnSubscribe: subscribe/unsubscribe to a channel.  Supports wildcard characters, so you can subscribe to a hierarchy of channels. Example: if you want to subscribe to all channels which start with 'news', then call Subscribe('news*'). 

 

   Publish: sends a message to all subscribed clients. Supports wildcard characters, so you can publish to a hierarchy of channels. Example: if you want to send a message to all subscribers to channels which start with 'news', then call Publish('news*').

 

   RPCResult: if a call RPC from the client is successful, the server will respond with this method.

 

   RPCError: if a call RPC from the client it has an error, the server will respond with this method.

 

   Broadcast: sends a message to all connected clients, if you need to broadcast a message to selected channels, use Channel argument.

 

   WriteData: sends a message to single or multiple selected clients.

 

 

Properties

   RPCAuthentication: if enabled, every time a client requests an RPC, method name needs to be authenticated against a username and password.

 

    Methods: is a list of allowed methods. Every time a client sends an RPC first it will search if this method is defined on this list, if it's not in this list, OnRPCAuthentication event will be fired.

 

    Subscriptions: returns a list of active subscriptions.

 

    UseMatchesMasks: if enabled, subscriptions and publish methods accepts wildcards, question marks... check MatchesMask Delphi function to see all supported masks.

 

 

Events

   OnRPCAuthentication: if RPC Authentication is enabled, this event is triggered to define if a client can call this method or not.

 

   OnRPC: fired when the server receives an RPC from a client.

 

   OnNotification: fired every server receive a Notification from a client.

 

   OnBeforeSubscription: fired every time before a client subscribes to a custom channel. Allows denying a subscription.

 

   OnSubscription: fired every time a client subscribes to a custom channel.

 

   OnUnSubscription: fired every time a client unsubscribes from a custom channel.

 

   OnRawMessage: this event is triggered before a message is processed by component.