using System; using System.Collections.Generic; using System.Linq; using System.Text; using SuperSocket.SocketBase; using SuperSocket.SocketBase.Command; using SuperSocket.SocketBase.Config; using SuperSocket.SocketBase.Logging; using SuperSocket.SocketBase.Protocol; using SuperWebSocket.Config; namespace SuperWebSocket.SubProtocol { /// /// SubProtocol basis /// /// The type of the web socket session. public abstract class SubProtocolBase : ISubProtocol where TWebSocketSession : WebSocketSession, new() { private SubProtocolBase() { } /// /// Initializes a new instance of the class. /// /// The name. public SubProtocolBase(string name) { Name = name; } /// /// Gets the name. /// public string Name { get; private set; } /// /// Initializes with the specified config. /// /// The app server. /// The protocol config. /// The logger. /// public abstract bool Initialize(IAppServer appServer, SubProtocolConfig protocolConfig, ILog logger); /// /// Gets or sets the sub request parser. /// /// /// The sub request parser. /// public IRequestInfoParser SubRequestParser { get; protected set; } /// /// Tries the get command. /// /// The name. /// The command. /// public abstract bool TryGetCommand(string name, out ISubCommand command); } }