/// <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())); }
/// <summary> /// Sends the specified packet to LFS. /// </summary> /// <param name="packet">The<see cref="ISendable"/> packet to send.</param> public void Send(ISendable packet) { if (packet == null) { throw new ArgumentNullException("packet"); } ThrowIfDisposed(); ThrowIfNotConnected(); TcpSocket.Send(packet.GetBuffer()); }
private void HandleSend(ISendable packet) { if (socket.IsConnected) { socket.Send(packet.GetBuffer()); } }