예제 #1
0
 internal static void CreateMD(ref byte[] buffer, RDTResponse resp, params int[] data)
 {
     byte[] d = new byte[data.Length * 4 + 1];
     d[0] = (byte)resp;
     for (int i = 0; i < data.Length; i++)
     {
         I2B(data[i], d, i * 4 + 1);
     }
     CreateDGram(ref buffer, d, 0);
 }
예제 #2
0
        protected virtual void OnMetaReceived()
        {
            // Parse metadata
            metareceived = true;
            RDTResponse res = (RDTResponse)buffer[0];

            filesize = Helper.B2I(buffer, 1);
            SendACK(0);
            Message("Metadata received. " + (res == RDTResponse.Accepted ? "FileSize=" + filesize : res.ToString()), MType.Important);
            if (res != RDTResponse.Accepted || filesize == 0)
            {
                OnFinished();
            }
        }