async Task <bool> TryQueueSend(ISendMessage command, TaskCompletionSource <IMessage> tcs) { var done = false; try { await Write(command.ToGameCommand()).ConfigureAwait(false); if (!(command is IReceiveMessage)) { tcs.SetResult(command); } else { done = true; } } catch (Exception e) { tcs.SetException(e); } return(done); }