public override Dynamic.Net.Base.INetCommand Execute(Dynamic.Net.Base.INetSession session) { if (InnerData != null && InnerData.Length > 0) { Content = session.Encoding.GetString(InnerData); } WebSocketSessionBase ws = session as WebSocketSessionBase; if (ws == null) { return(null); } MessageReceivedEventArgs args = new MessageReceivedEventArgs() { Content = this.Content, ContentType = MessageContentType.Text, Data = InnerData, Session = ws, IsAync = false }; ws.OnMessageReceived(args); INetCommand responseCommand = null; if (!args.IsAync && !String.IsNullOrEmpty(args.ResponseContent)) { responseCommand = WebSocketCommandFactory.CreateCommand(args.ResponseContent); } return(responseCommand); }
public override Dynamic.Net.Base.INetCommand Execute(Dynamic.Net.Base.INetSession session) { WebSocketSessionBase ws = session as WebSocketSessionBase; if (ws == null) { return(null); } MessageReceivedEventArgs args = new MessageReceivedEventArgs() { ContentType = MessageContentType.Binary, Data = InnerData, Session = session as WebSocketSessionBase, IsAync = false }; ws.OnMessageReceived(args); INetCommand responseCommand = null; if (!args.IsAync && args.ResponseData != null && args.ResponseData.Length > 0) { responseCommand = WebSocketCommandFactory.CreateCommand(args.ResponseData); } return(responseCommand); }