123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Collections;
- using CommonLang.Protocol;
- using CommonLang.Net;
- namespace CommonServer.Server
- {
-
-
-
- public interface ISession : AbstractSession
- {
-
-
-
- string ID { get; }
- bool IsConnected { get; }
-
-
-
- long TotalSentBytes { get; }
-
-
-
- long TotalRecvBytes { get; }
- ISessionListener Listener { get; }
-
-
-
-
-
- bool Disconnect(bool force);
-
-
-
-
-
- bool Send(IMessage message);
-
-
-
-
-
-
- bool SendResponse(IMessage request, IMessage response);
-
-
-
-
- string GetRemoteAddress();
- }
-
-
-
- public interface ISessionListener
- {
-
-
-
-
- void OnConnected(ISession session);
-
-
-
-
-
-
- void OnDisconnected(ISession session, bool force, String reason);
-
-
-
-
-
- void OnError(ISession session, Exception err);
-
-
-
-
-
- void OnSentMessage(ISession session, object message);
-
-
-
-
-
- void OnReceivedMessage(ISession session, object message);
-
- }
- }
|