private void Callback(IAsyncResult ar)
    {
        IPEndPoint ip = new IPEndPoint(IPAddress.Any, NetConst.Port);

        byte[] receiveBytes = Client.EndReceive(ar, ref ip);
        var    reader       = new ReaderMsg(receiveBytes);

        ReadHeader(reader);
        Client.BeginReceive(Callback, null);
    }
Esempio n. 2
0
    protected void ReadHeader(ReaderMsg reader)
    {
        var code = reader.ReadUShort();

        Dict[code](reader);
    }
Esempio n. 3
0
 public virtual void Derializer(ReaderMsg reader)
 {
 }
 public override void Derializer(ReaderMsg reader)
 {
     GameObjectName = reader.ReadString();
     IsActive       = reader.ReadBool();
 }