123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using CommonLang.Protocol;
- using System.Collections.Specialized;
- using CommonLang.Net;
- namespace CommonServer.Server
- {
-
-
-
- public interface IServerListener
- {
-
-
-
-
- void OnInit(IServer server);
-
-
-
- void OnDestory();
-
-
-
-
-
- ISessionListener OnSessionConnected(ISession session);
- }
-
-
-
- public interface IServerFactory
- {
- IServer CreateServer(INetPackageCodec codec);
- }
- public interface IServer
- {
-
-
-
- string ClientConnectString { get; }
-
-
-
- INetPackageCodec PackageCodec { get; }
-
-
-
- int SessionCount { get; }
-
-
-
-
-
- void Open(IDictionary<string, string> config, IServerListener listener);
-
-
-
- void Dispose();
-
-
-
-
- void Broadcast(IMessage message);
-
-
-
-
-
- bool HasSession(ISession session);
-
-
-
-
-
- ISession GetSessionByID(string sessionID);
-
-
-
-
- IEnumerable<ISession> GetSessions();
- long TotalSentBytes { get; }
- long TotalRecvBytes { get; }
- void SetEmulateLaggingMS(int min, int max);
- void GetEmulateLaggingMS(out int min, out int max);
- }
- }
|