title: sslstream "The BeginWrite method cannot be called when another write operation is pending"
body: <p>I am having a bit of trouble getting the sslstream to work with sending multiple message after each other.</p>
  
  <p>The way i call my client to send data</p>
  
  <pre><code>client.Send(objectOne);
  client.Send(objectTwo);
  </code></pre>
  
  <p>the error message i receive is:</p>
  
  <pre><code>The BeginWrite method cannot be called when another write operation is pending
  </code></pre>
  
  <p>i have tried different solutions to get this to work, but none gets the it to work.</p>
  
  <p>The base function uses await, and that function gets called</p>
  
  <pre><code>// client send
  public void Send(object data)
  {
      byte[] sendData = SerializationHelper.Serialize(data);
      base.Send(sendData);
  }
  // base send
  protected async void Send(byte[] data)
  {
      await stream.WriteAsync(data, 0, data.Length);
  }
  </code></pre>
  
  <p>Base function returns a task, and uses await in the client method</p>
  
  <pre><code>// client send
  public async void Send(object data)
  {
      byte[] sendData = SerializationHelper.Serialize(data);
      await base.Send(sendData);
  }
  // base send
  protected async Task Send(byte[] data)
  {
      await stream.WriteAsync(data, 0, data.Length);
  }
  </code></pre>
  
  <p>i still receive the same error, anyone have any idea to get this to work?</p>