public override void IncommingBinary(XSockets.Core.Common.Socket.IXBaseSocket sender, XSockets.Core.Common.Socket.Event.Interface.IBinaryArgs e) { // Just pass back the "blob" to the sender // This is where you do stuff with the blob :-) this.Send(e); //this.SendToAll(e); // Send the blob to all clients that subscribes to blobs on this Controller }
private void OnFoo(XSockets.Client40.Common.Event.Interface.ITextArgs obj) { Console.WriteLine(""); }
private void MyCustomBinaryController_OnIncommingBinary(object sender, XSockets.Core.Common.Socket.Event.Arguments.BinaryArgs e) { // throw new System.NotImplementedException(); }
/// <summary> /// Override all incomming text messages /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public override void IncommingText(IXBaseSocket sender, XSockets.Core.XSocket.Event.Interface.ITextArgs e) { base.IncommingText(sender, e); }
/// <summary> /// Override all incomming binary messages /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public override void IncommingBinary(IXBaseSocket sender, XSockets.Core.XSocket.Event.Interface.IBinaryArgs e) { base.IncommingBinary(sender, e); }
/// <summary> /// Override all error messages /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public override void HandleError(object sender, XSockets.Core.XSocket.Event.Arguments.OnErrorArgs e) { base.HandleError(sender, e); }
/// <summary> /// When a client connects we expect a city parameter to be attached. See default-3.htm (and readme.txt) /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void GeoLocation_OnClientConnect(object sender, XSockets.Core.Common.Socket.Event.Arguments.OnClientConnectArgs e) { try { this.ViewModel.City = e.XNode.XSocket.ProtocolInstance.Parameters["City"]; } catch (Exception ex) { //Note: To catch errors in the client listen for error like the example below. //ws.bind(XSockets.Events.onError, function (err) { // console.log('Error', err); //}); this.DispatchError(ex, "Whops... error when reading the City parameter. Probably because you ran default-1.htm or default-2.htm. The City parameter was added in default-3.htm"); } }
void Wss_OnError(object sender, XSockets.Core.Common.Socket.Event.Arguments.OnErrorArgs e) { Trace.TraceError("Error" + e.ToString()); }