TsgcWSPClient_sgc

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

 

Methods

  Publish: sends a message to all subscribed clients.

 

  RPC: Remote Procedure Call, client request a method and response will be handled OnRPCResult or OnRPCError events.

 

  Notify: the client sends a notification to a server, this notification doesn't need a response.

 

  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 a server. If you need to send a message to a custom TsgcWSProtocol_Server_sgc, use "Guid" Argument. If you need to send a message to a single channel, use "Channel" Argument.

 

  Subscribe: subscribe client to a custom channel. If the client is subscribed, OnSubscription event will be fired.

 

  Unsubscribe: unsubscribe client to a custom channel. If the client is unsubscribed, OnUnsubscription event will be fired.

 

  UnsubscribeAll: unsubscribe client from all subscribed channel. If the client is unsubscribed, OnUnsubscription event will be fired for every channel.

 

  GetSession: requests to server session id, data session is received OnSession Event.

 

  StartTransaction: begins a new transaction.

 

  Commit: server processes all messages queued in a transaction.

 

  RollBack: server deletes all messages queued in a transaction.

 

 

 

 

Events

  OnEvent: this event is fired every time a client receives a message from a custom channel.

 

  OnRPCResult: this event is fired when the client receives a successful response from the server after a RPC is sent.

 

  OnRPCError: this event is fired when the client receives a error response from the server after an RPC is sent.

 

  OnAcknowledgment: this event is triggered when the client receives error an acknowledgment from the server that message has been received.

 

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

 

  OnSession: this event is fired after a successful connection or after a GetSession request.

 

 

 

Properties

   Queue: disabled by default, if True all text/binary messages are not processed and queued until queue is disabled.

 

   QoS: Three "Quality of Service" provided:

 

Level 0: "At most once", the message is delivered according to the best efforts of the underlying TCP/IP network. A response is not expected and no retry semantics are defined in the protocol. The message arrives at the server either once or not at all.

 

Level 1: "At least once", the receipt of a message by the server is acknowledged by an ACKNOWLEDGMENT message. If there is an identified failure of either the communications link or the sending device, or the acknowledgement message is not received after a specified period of time, the sender resends the message. The message arrives at the server at least once. A message with QoS level 1 has an ID param in the message.

 

Level 2: "Exactly once", where message are assured to arrive exactly once. This level could be used, for example, with billing systems where duplicate or lost messages could lead to incorrect charges being applied. If there is an identified failure of either the communications link or the sending device, or the acknowledgement message is not received after a specified period of time, the sender resends the message.

 

    Subscriptions: returns a list of active subscriptions.