public override void OnText(IWebSocketConnection sender, TextFrameEventArgs args) { //Echo the text back to the client sender.SendText(args.Message); base.OnText(sender, args); }
private void textControl1_TextFrameDeactivated(object sender, TextFrameEventArgs e) { if (e.TextFrame.Name == "FN") { textControl1.EditMode = EditMode.Edit; } }
private static void Client_TextFrame(object sender, TextFrameEventArgs e) { _logger.Information(typeof(MainWindow), "Client: {0}", e.Text); var client = (ChatWebSocketClient)sender; // lets test the close handshake client.Dispose(); }
private static void Client_TextFrame(object sender, TextFrameEventArgs e) { Trace.TraceInformation("Client: {0}", e.Text); var client = (ChatWebSocketClient)sender; // lets test the close handshake client.Dispose(); }
public override void OnText(IWebSocketConnection sender, TextFrameEventArgs args) { Logger.Info($"{sender.ClientIdentifier}/{sender.UniqueIdentifier} sent {args.Message.Length * 2} bytes"); ConnectionManager.Broadcast(args.Message); base.OnText(sender, args); }
/// <summary> /// Called when [text]. /// </summary> /// <param name="sender">The sender.</param> /// <param name="args">The <see cref="TextFrameEventArgs"/> instance containing the event data.</param> public override void OnText(IWebSocketConnection sender, TextFrameEventArgs args) { ISignal signal = JsonConvert.DeserializeObject <Signal>(args.Message); if (signal.Sender != sender.ClientIdentifier) { Logger.Warn($"Signal from {sender.ClientIdentifier} sent with spoofed sender ({signal.Sender}). Forcibly setting to connection's client identifier."); signal.Sender = sender.ClientIdentifier; } signal.SenderIdentifier = sender.UniqueIdentifier; try { _signalRouter.Route(signal); } catch (InvalidExtensionException ex) { Logger.Error(ex); } base.OnText(sender, args); }
private void FrameBuilder_OnTextFrame(object sender, TextFrameEventArgs e) { base.OnTextFrame(e.Text); }
/// <summary> /// Called when [text]. /// </summary> /// <param name="sender">The sender.</param> /// <param name="args">The <see cref="T:PWebSocketServer.Common.Events.TextFrameEventArgs" /> instance containing the event data.</param> public virtual void OnText(IWebSocketConnection sender, TextFrameEventArgs args) { }