DWHttpServerBuffer Class Reference
Inherits from | NSObject |
---|---|
Declared in | DWHttpServerBuffer.h DWHttpServerBuffer.m |
Overview
buffer 管理器,用来管理 client <-> DWHttpServerConnection <-> DWServerProxy 之间的交互数据。
DWHttpServerConnection 接收 DWServerProxy 的数据存入 buffer中,形成一个缓存数据链。 DWHttpServerConnection 将数据链中的数据发送给 client。
range
data未使用的数据范围。
@property (assign, nonatomic) NSRange range
Discussion
data未使用的数据范围。
Declared In
DWHttpServerBuffer.h
data
实际的数据
@property (strong, nonatomic) NSData *data
Discussion
实际的数据
Declared In
DWHttpServerBuffer.h
– initWithData:
通过 NSData 初始化 buffer 管理器
- (id)initWithData:(NSData *)data
Parameters
data |
放入 buffer 管理器的数据 |
---|
Return Value
buffer 管理器
Discussion
通过 NSData 初始化 buffer 管理器
Declared In
DWHttpServerBuffer.h
– initWithHttpResponse:
通过 NSHTTPURLResponse 初始化 buffer 管理器 buffer 管理器会将 NSHTTPURLResponse 转化为标准的 http response header 存入 data 中,并设置 range。
- (id)initWithHttpResponse:(NSHTTPURLResponse *)response
Parameters
response |
放入 buffer 管理器的数据 |
---|
Return Value
buffer 管理器
Discussion
通过 NSHTTPURLResponse 初始化 buffer 管理器 buffer 管理器会将 NSHTTPURLResponse 转化为标准的 http response header 存入 data 中,并设置 range。
Declared In
DWHttpServerBuffer.h
– getRemainBuffer
获取 buffer 管理其中未使用的数据。若 buffer 中已无可用的数据,则返回初始化为空的 NSData。
- (NSData *)getRemainBuffer
Return Value
返回 buffer 管理器中未使用的数据。
Discussion
获取 buffer 管理其中未使用的数据。若 buffer 中已无可用的数据,则返回初始化为空的 NSData。
Declared In
DWHttpServerBuffer.h