# Class NetProtocolPako

Pako.js 数据压缩协议

#### Hierarchy

- NetProtocolPako

#### Implements

- IProtocolHelper

- Defined in assets/libs/network/NetProtocolPako.ts:26

#####
Index

### Constructors

constructor

### Methods

checkResponsePackage
getHeadlen
getHearbeat
getPackageId
getPackageLen
handlerRequestPackage
handlerResponsePackage

## Constructors

### constructor

- new NetProtocolPako(): NetProtocolPako

- #### Returns NetProtocolPako

## Methods

### checkResponsePackage

- checkResponsePackage(respProtocol: IResponseProtocol ): boolean

- 检查包数据是否合法（避免客户端报错崩溃）

  #### Parameters

  - ##### respProtocol: IResponseProtocol

  #### Returns boolean

  Implementation of IProtocolHelper.checkResponsePackage

  - Defined in assets/libs/network/NetProtocolPako.ts:39

### getHeadlen

- getHeadlen(): number

- 返回包头长度

  #### Returns number

  Implementation of IProtocolHelper.getHeadlen

  - Defined in assets/libs/network/NetProtocolPako.ts:27

### getHearbeat

- getHearbeat(): NetData

- 返回一个心跳包

  #### Returns NetData

  Implementation of IProtocolHelper.getHearbeat

  - Defined in assets/libs/network/NetProtocolPako.ts:31

### getPackageId

- getPackageId(respProtocol: IResponseProtocol ): string

- 返回包的id或协议类型

  #### Parameters

  - ##### respProtocol: IResponseProtocol

  #### Returns string

  Implementation of IProtocolHelper.getPackageId

  - Defined in assets/libs/network/NetProtocolPako.ts:66

### getPackageLen

- getPackageLen(msg: NetData ): number

- 返回整个包的长度

  #### Parameters

  - ##### msg: NetData

  #### Returns number

  Implementation of IProtocolHelper.getPackageLen

  - Defined in assets/libs/network/NetProtocolPako.ts:35

### handlerRequestPackage

- handlerRequestPackage(reqProtocol: IRequestProtocol ): string

- 处理请求包数据

  #### Parameters

  - ##### reqProtocol: IRequestProtocol

  #### Returns string

  Implementation of IProtocolHelper.handlerRequestPackage

  - Defined in assets/libs/network/NetProtocolPako.ts:57

### handlerResponsePackage

- handlerResponsePackage(respProtocol: IResponseProtocol ): boolean

- 处理响应包数据

  #### Parameters

  - ##### respProtocol: IResponseProtocol

  #### Returns boolean

  Implementation of IProtocolHelper.handlerResponsePackage

  - Defined in assets/libs/network/NetProtocolPako.ts:43

Generated using TypeDoc