123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- namespace XGame.Framework.Network
- {
- public enum SessionStatus
- {
- NONE,
- CONNECTING,
- CONNECTED,
- CONNECT_TIMEOUT,
- CONNECT_FAIL,
- FREE,
- DISCONNECT_ERROR,
- SEND_ERROR,
- RECV_ERROR,
- CLOSED
- }
-
- public interface IRemoteSession
- {
- /// <summary>
- /// 会话状态
- /// </summary>
- SessionStatus Status { get; }
- /// <summary>
- /// 远端地址解析信息
- /// </summary>
- SessionAddress Address { get; }
- /// <summary>
- /// 是否连接
- /// </summary>
- /// <param name="bPrecice"></param>
- /// <returns></returns>
- bool IsConnected(bool bPrecice);
- /// <summary>
- /// 断开连接
- /// </summary>
- void Disconnect();
- /// <summary>
- /// 发送
- /// </summary>
- /// <param name="bytes"></param>
- /// <param name="offset"></param>
- /// <param name="length"></param>
- /// <returns></returns>
- bool Send(byte[] bytes, int offset, int length);
- /// <summary>
- /// 连接
- /// </summary>
- /// <param name="ip"></param>
- /// <param name="port"></param>
- void Connect(AddressInfo address);
- }
- }
|