ReadShort() 공개 메소드

2字节读出
public ReadShort ( ) : ushort
리턴 ushort
예제 #1
0
    void OnReceivedInternal(MemoryStream ms)
    {
        BinaryReader br = new BinaryReader(ms);

        byte[] message = br.ReadBytes((int)(ms.Length - ms.Position));
        br.Close();
        ms.Close();
        ms.Dispose();

        NetBuffer temp = new NetBuffer(message);
        ushort    cmd  = temp.ReadShort();

        byte[] buf = temp.ReadRemaining();
        SocketClientManager.AddEvent(cmd.ToString(), new NetBuffer(buf));
    }
예제 #2
0
 public override void ReadFromBuffer(NetBuffer buffer)
 {
     value = buffer.ReadShort();
 }
예제 #3
0
    void OnReceivedInternal(MemoryStream ms)
    {
        BinaryReader br = new BinaryReader(ms);
        byte[] message = br.ReadBytes((int)(ms.Length - ms.Position));
        br.Close();
        ms.Close();
        ms.Dispose();

        NetBuffer temp = new NetBuffer(message);
        ushort cmd = temp.ReadShort();
        byte[] buf = temp.ReadRemaining();
        SocketClientManager.AddEvent(cmd.ToString(), new NetBuffer(buf));
    }