- 首先抽象出了connection相关的接口,然后实现了connection的基本功能,包括读写,关闭,获取连接信息等,以及连接属性的一些getter和setter方法
- 抽象了connectionManager的接口,用于connection的管理
- 抽象了message的接口,用于message的封装和解封装,为了解决TCP的粘包问题,这里使用了TLV的方式进行封装和解封装
- 抽象了router接口,定义消息的handler方法,这里使用了代理模式的理念,使用了两个钩子函数,分别是preHandle和postHandle,用于在处理业务之前和之后进行一些操作,比如日志记录等
- 抽象了msgHandle接口,用于管理router,以及执行router的handler方法,抽象了worker连接池,用于管理worker,通过复用的方式提高资源的利用率
- 抽象了request接口,是对connection和message的进一步封装
- 抽象了server的接口,用于管理server,包括启动,停止,路由的注册等,以及使用钩子函数来进行资源的初始化和释放
-
Notifications
You must be signed in to change notification settings - Fork 0
License
Zurichcape/GoNet
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
License
Stars
Watchers
Forks
Releases
No releases published