# Interface IProtocolHelper

协议辅助接口

#### Hierarchy

- IProtocolHelper

#### Implemented by

- NetProtocolPako

- Defined in assets/libs/network/NetInterface.ts:54

#####
Index

### Methods

checkResponsePackage
getHeadlen
getHearbeat
getPackageId
getPackageLen
handlerRequestPackage
handlerResponsePackage

## Methods

### checkResponsePackage

- checkResponsePackage(msg: IResponseProtocol ): boolean

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

  #### Parameters

  - ##### msg: IResponseProtocol

  #### Returns boolean

  - Defined in assets/libs/network/NetInterface.ts:62

### getHeadlen

- getHeadlen(): number

- 返回包头长度

  #### Returns number

  - Defined in assets/libs/network/NetInterface.ts:56

### getHearbeat

- getHearbeat(): NetData

- 返回一个心跳包

  #### Returns NetData

  - Defined in assets/libs/network/NetInterface.ts:58

### getPackageId

- getPackageId(msg: IResponseProtocol ): string

- 返回包的id或协议类型

  #### Parameters

  - ##### msg: IResponseProtocol

  #### Returns string

  - Defined in assets/libs/network/NetInterface.ts:68

### getPackageLen

- getPackageLen(msg: NetData ): number

- 返回整个包的长度

  #### Parameters

  - ##### msg: NetData

  #### Returns number

  - Defined in assets/libs/network/NetInterface.ts:60

### handlerRequestPackage

- handlerRequestPackage(reqProtocol: IRequestProtocol ): string

- 处理请求包数据

  #### Parameters

  - ##### reqProtocol: IRequestProtocol

  #### Returns string

  - Defined in assets/libs/network/NetInterface.ts:64

### handlerResponsePackage

- handlerResponsePackage(respProtocol: IResponseProtocol ): boolean

- 处理响应包数据

  #### Parameters

  - ##### respProtocol: IResponseProtocol

  #### Returns boolean

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

Generated using TypeDoc