项目主页 http://www.oschina.net/p/hp-socket 下载地址 https://github.com/ldcsaa/HP-Socket
目 录
前 言................................................................................................................................................. 1
1 概 述 ......................................................................................................................................... 3
1.1 整体架构 ................................................................................................................... 3
1.2 组件分类 ................................................................................................................... 5
1.3 组件接口 ................................................................................................................... 6
1.4 监听器接口 ............................................................................................................... 8
2 框架详述 ................................................................................................................................. 12
2.1 关键概念 ................................................................................................................. 12
2.1.1 接收模型 ......................................................................................................... 12
2.1.2 发送策略 ......................................................................................................... 15
2.1.3 接收策略 ......................................................................................................... 16
2.1.4 连接方式 ......................................................................................................... 16
2.1.5 连接绑定 ......................................................................................................... 18
2.2 Server 组件 ............................................................................................................. 20
2.2.1 接口描述 ......................................................................................................... 20
2.2.2 工作流程 ......................................................................................................... 23
2.3 Agent 组件 .............................................................................................................. 25
2.3.1 接口描述 ......................................................................................................... 25
2.3.2 工作流程 ......................................................................................................... 28
2.4 Client 组件 .............................................................................................................. 29
2.4.1 接口描述 ......................................................................................................... 29
2.4.2 工作流程 ......................................................................................................... 32
3 SSL .......................................................................................................................................... 34
3.1 组件接口 ................................................................................................................. 34
3.2 SSL 运行环境 ......................................................................................................... 36
4 HTTP ....................................................................................................................................... 38
4.1 组件接口 ................................................................................................................. 38
4.2 HTTP 监听器事件 .................................................................................................. 41
4.3 Cookie 管理 ............................................................................................................ 45
5 Linux ....................................................................................................................................... 50
5.1 组件概述 ................................................................................................................. 50
5.2 安装使用 ................................................................................................................. 50
6 使用方式 ................................................................................................................................. 51
6.1 源代码 ..................................................................................................................... 51
6.2 静态库 ..................................................................................................................... 51
6.3 HPSocket DLL ........................................................................................................ 51
6.4 HPSocket4C DLL ................................................................................................... 52
6.5 其它编程语言使用 HPSocket ................................................................................ 53
7 附 录 ....................................................................................................................................... 54
7.1 示例 Demo .............................................................................................................. 54
7.1.1 Windows 示例 ................................................................................................. 54
7.1.2 Linux 示例 ...................................................................................................... 55
7.2 辅助函数 ................................................................................................................. 57
7.3 FAQ ......................................................................................................................... 59