public void RequestFile(Connection connection, byte exchangeType, byte[] hash)
            {
                string hashString = hash.GetHexaString();

                Console.WriteLine("> RequestFile: {0} ({1})", exchangeType, hashString);

                byte[] fileData = FileDataExchangeUtils.GetCachedFile(ref exchangeType, ref hash);
                FileDataExchangeUtils.SendAddFileMessage(connection, ref exchangeType, ref hash, ref fileData);
            }
Exemplo n.º 2
0
        public void CheckFileExistResponse(Connection connection, byte exchangeType, byte[] hash, bool exists)
        {
            string hashString = hash.GetHexaString();

            Console.WriteLine("> CheckFileExistResponse: {0} - {1} ({2})", exchangeType, exists, hashString);

            if (exists)
            {
                return;
            }

            byte[] fileData = FileDataExchangeUtils.GetCachedFile(ref exchangeType, ref hash);
            FileDataExchangeUtils.SendAddFileMessage(connection, ref exchangeType, ref hash, ref fileData);
        }
Exemplo n.º 3
0
 public void AddFile(Connection connection, byte exchangeType, byte[] hash, byte[] data)
 {
     FileDataExchangeUtils.SendAddFileMessage(connection, ref exchangeType, ref hash, ref data);
 }