title: TCP Socket doesn't send all the data
body: <p>I'm trying to send about 250KBytes but I get cut at 8KBytes
  I doesn't need any answer from the remote server.
  I don't understand what I'm doing wrong.
  Is like the tx doesn't change the outbuffer size.</p>
  <pre><code>Private Function SendReport7B(ByVal Msg As String, ByVal Host As String, ByVal Port As String) As String
      Try
          Dim Msgs() As String
          Dim Tx As New TcpClient()
  
          Dim stream As NetworkStream = Nothing
          Dim LingerMode As New LingerOption(True, 1)
          'Dim BSize As Integer
  
          Tx.NoDelay = True
          Tx.LingerState = LingerMode
          Tx.SendTimeout = 5000
  
          If Msg.Length &gt; Tx.SendBufferSize Then
              Tx.SendBufferSize = Msg.Length + 256
          End If
  
          Tx.Connect(Host, Port)
  
          Msgs = Msg.Split(Chr(10))
  
          ' Translate the passed message into ASCII and store it as a Byte array.
          Dim data As [Byte]() = System.Text.Encoding.ASCII.GetBytes(Msg)
  
          ' Get a client stream for reading and writing.
          '  Stream stream = client.GetStream();
          stream = Tx.GetStream()
          'stream.WriteTimeout = 100
          ' Send the message to the connected TcpServer. 
          stream.Write(data, 0, data.Length)
  
        
          Tx.Close()
  
          Return &quot;OK&quot; 'responseData
      Catch ex As Exception
          Return &quot;Error: &quot; &amp; ex.Message
      End Try
  
  End Function
  </code></pre>