Example #1
0
 public void RelayError(ToxErrorFileSendChunk error)
 {
     if (error != ToxErrorFileSendChunk.Ok)
     {
         Debug.WriteLine("An unexpected error occurred when sending a file chunk: " + error);
     }
 }
Example #2
0
 internal static extern bool FileSendChunk(ToxHandle tox, uint friendNumber, uint fileNumber, ulong position, byte[] data, uint length, ref ToxErrorFileSendChunk error);
Example #3
0
 internal static extern bool FileSendChunk(ToxHandle tox, uint friendNumber, uint fileNumber, ulong position, byte[] data, uint length, ref ToxErrorFileSendChunk error);
 public void RelayError(ToxErrorFileSendChunk error)
 {
     if (error != ToxErrorFileSendChunk.Ok)
         Debug.WriteLine("An unexpected error occurred when sending a file chunk: " + error);
 }
Example #5
0
        /// <summary>
        /// Sends a chunk of file data to a friend. This should be called in response to OnFileChunkRequested.
        /// </summary>
        /// <param name="friendNumber">The friend to send the chunk to.</param>
        /// <param name="fileNumber">The file transfer that this chunk belongs to.</param>
        /// <param name="position">The position from which to continue reading.</param>
        /// <param name="data">The data to send. (should be equal to 'Length' received through OnFileChunkRequested).</param>
        /// <param name="error"></param>
        /// <returns>True on success.</returns>
        public bool FileSendChunk(int friendNumber, int fileNumber, long position, byte[] data, out ToxErrorFileSendChunk error)
        {
            ThrowIfDisposed();

            if (data == null)
                throw new ArgumentNullException("data");

            error = ToxErrorFileSendChunk.Ok;

            return ToxFunctions.FileSendChunk(_tox, (uint)friendNumber, (uint)fileNumber, (ulong)position, data, (uint)data.Length, ref error);
        }
Example #6
0
 public static extern Boolean SendChunk(ToxHandle tox, UInt32 friendNumber, UInt32 fileNumber, UInt64 position, Byte[] data, SizeT length, ref ToxErrorFileSendChunk error);