Example #1
0
        public WebSocketDialogChannelConnection(BaseSubscriptionApi subscriptionApi, WebSocketDialog webSocketDialog) : base(subscriptionApi)
        {
            this.webSocketDialog = webSocketDialog;

            this.webSocketDialog.OnTextReceived += (sender, eventArgs) => {
                try {
                    this.ReceiveMessageAsync(eventArgs.Text).Wait();
                }
                catch (Exception e) {
                    logger.Trace(e);
                    this.Dispose();
                    webSocketDialog.Close();
                }
            };
        }
 public MyWebSocketsServer(BaseSubscriptionApi subscriptionApi, Func <IWebRequest, IChannelConnection, bool> onNewChannel)
 {
     this.subscriptionApi = subscriptionApi;
     this.onNewChannel    = onNewChannel;
 }
 public EmbedIOSubscriptionApiConnection(BaseSubscriptionApi subscriptionApi, Action <string> send, IWebSocketContext context) : base(subscriptionApi)
 {
     this.send    = send;
     this.context = context;
 }