You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
926 B

4 years ago
  1. // Package ziface 主要提供zinx全部抽象层接口定义.
  2. // 包括:
  3. // IServer 服务mod接口
  4. // IRouter 路由mod接口
  5. // IConnection 连接mod层接口
  6. // IMessage 消息mod接口
  7. // IDataPack 消息拆解接口
  8. // IMsgHandler 消息处理及协程池接口
  9. //
  10. // 当前文件描述:
  11. // @Title iconnmanager.go
  12. // @Description 连接管理相关,包括添加、删除、通过一个连接ID获得连接对象,当前连接数量、清空全部连接等方法
  13. // @Author Aceld - Thu Mar 11 10:32:29 CST 2019
  14. package ziface
  15. /*
  16. 连接管理抽象层
  17. */
  18. type IConnManager interface {
  19. Add(conn IConnection) //添加链接
  20. Remove(conn IConnection) //删除连接
  21. Get(connID uint32) (IConnection, error) //利用ConnID获取链接
  22. Len() int //获取当前连接
  23. ClearConn() //删除并停止所有链接
  24. }