WebSocket Channel Wildcards

From sgcWebSockets 4.1.6 default SGC Protocol supports wildcards in Subscribe, UnSubscribe and Publish methods, websocket protocol.

Channel is a string used by server to filter messages for each connected client. A channel can consists of one or more levels, usually each topic is separated by a forward slash. Example

  weather/usa/california/San Francisco/Silicon Valley

 

When a client subscribe to a channel it can use exact channel name or can subscribe to more channels at once by using wildcards. Example:

 

  weather/usa/california/*

  weather/usa/*

 

Wildcards only works for active channels, so you can create some persistent channels before server is started:

 

  WSPPROTOCOL.Subscriptions.Add(NewGuid + '_' + 'weather/usa/california';

  WSPPROTOCOL.Subscriptions.Add(NewGuid + '_' + 'weather/usa';