123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
- using System.Net.Security;
- using System.Security.Authentication;
- using System.Security.Cryptography.X509Certificates;
- using System.Text;
- using Microsoft.Extensions.Logging;
- using SuperSocket.Common;
- using SuperSocket.SocketBase.Command;
- using SuperSocket.SocketBase.Config;
- using SuperSocket.SocketBase.Logging;
- using SuperSocket.SocketBase.Protocol;
- using SuperSocket.SocketBase.Provider;
- namespace SuperSocket.SocketBase
- {
-
-
-
- public interface IAppServer : IWorkItem, ILoggerProvider
- {
-
-
-
-
-
-
- DateTime StartedTime { get; }
-
-
-
-
-
-
- ListenerInfo[] Listeners { get; }
-
-
-
- object ReceiveFilterFactory { get; }
-
-
-
- X509Certificate Certificate { get; }
-
-
-
- SslProtocols BasicSecurity { get; }
-
-
-
-
-
- IAppSession CreateAppSession(ISocketSession socketSession);
-
-
-
-
-
- bool RegisterSession(IAppSession session);
-
-
-
-
-
- IAppSession GetSessionByID(string sessionID);
-
-
-
-
-
- void ResetSessionSecurity(IAppSession session, SslProtocols security);
-
-
-
- ILoggerFactory LogFactory { get; }
- }
-
-
-
-
- public interface IRawDataProcessor<TAppSession>
- where TAppSession : IAppSession
- {
-
-
-
-
-
-
-
-
- event Func<TAppSession, byte[], int, int, bool> RawDataReceived;
- }
-
-
-
-
- public interface IAppServer<TAppSession> : IAppServer
- where TAppSession : IAppSession
- {
-
-
-
-
-
- IEnumerable<TAppSession> GetSessions(Func<TAppSession, bool> critera);
-
-
-
-
- IEnumerable<TAppSession> GetAllSessions();
-
-
-
- event SessionHandler<TAppSession> NewSessionConnected;
-
-
-
- event SessionHandler<TAppSession, CloseReason> SessionClosed;
- }
-
-
-
-
-
- public interface IAppServer<TAppSession, TRequestInfo> : IAppServer<TAppSession>
- where TRequestInfo : IRequestInfo
- where TAppSession : IAppSession, IAppSession<TAppSession, TRequestInfo>, new()
- {
-
-
-
- event RequestHandler<TAppSession, TRequestInfo> NewRequestReceived;
- }
-
-
-
-
- public interface IRequestHandler<TRequestInfo>
- where TRequestInfo : IRequestInfo
- {
-
-
-
-
-
- void ExecuteCommand(IAppSession session, TRequestInfo requestInfo);
- }
-
-
-
- public interface ISocketServerAccessor
- {
-
-
-
-
-
-
- ISocketServer SocketServer { get; }
- }
-
-
-
- public interface IRemoteCertificateValidator
- {
-
-
-
-
-
-
-
-
-
- bool Validate(IAppSession session, object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors);
- }
- }
|