C# Class GameCore.NetWork.SocketNetPacket

Inheritance: INetPacket
Exibir arquivo Open project: recter/Unity-Net Class Usage Examples

Public Methods

Method Description
Clear ( ) : void

清空数据

GetBody ( int &nBodySize ) : Byte[]

获取消息包体内容 - 包身

GetBuffer ( int &nBufferSize ) : Byte[]

获取消息包数据缓存 - 包括包头和包身

GetMessageID ( ) : Int16

获取消息号

GetSize ( ) : int

获取包大小

IsPackHead ( Byte data ) : bool

判断是否是包头数据

SetPackBody ( Byte bodyData ) : bool

设置包身的数据

SetPackHead ( Byte headData ) : bool

设置包头的数据

SocketNetPacket ( Int16 nMessageID, int bodysize ) : System

Method Details

Clear() public method

清空数据
public Clear ( ) : void
return void

GetBody() public method

获取消息包体内容 - 包身
public GetBody ( int &nBodySize ) : Byte[]
nBodySize int
return Byte[]

GetBuffer() public method

获取消息包数据缓存 - 包括包头和包身
public GetBuffer ( int &nBufferSize ) : Byte[]
nBufferSize int
return Byte[]

GetMessageID() public method

获取消息号
public GetMessageID ( ) : Int16
return System.Int16

GetSize() public method

获取包大小
public GetSize ( ) : int
return int

IsPackHead() public static method

判断是否是包头数据
public static IsPackHead ( Byte data ) : bool
data Byte
return bool

SetPackBody() public method

设置包身的数据
public SetPackBody ( Byte bodyData ) : bool
bodyData Byte
return bool

SetPackHead() public method

设置包头的数据
public SetPackHead ( Byte headData ) : bool
headData Byte
return bool

SocketNetPacket() public method

public SocketNetPacket ( Int16 nMessageID, int bodysize ) : System
nMessageID System.Int16
bodysize int
return System