Ejemplo n.º 1
0
        /// <summary>
        /// Sends the specified sequence of packets to LFS asynchronously.
        /// </summary>
        /// <param name="packets">The sequence of <see cref="ISendable"/> packets to send.</param>
        /// <returns>An awaitable async task object.</returns>
        public Task SendAsync(params ISendable[] packets)
        {
            if (packets == null)
            {
                throw new ArgumentNullException("packets");
            }

            ThrowIfDisposed();
            ThrowIfNotConnected();

            return(TcpSocket.SendAsync(GetSendBuffer(packets)));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Sends the specified packet to LFS asynchronously.
        /// </summary>
        /// <param name="packet">The<see cref="ISendable"/> packet to send.</param>
        /// <returns>An awaitable async task object.</returns>
        public Task SendAsync(ISendable packet)
        {
            if (packet == null)
            {
                throw new ArgumentNullException("packet");
            }

            ThrowIfDisposed();
            ThrowIfNotConnected();

            return(TcpSocket.SendAsync(packet.GetBuffer()));
        }