C
cmjman
I have an issue where networkStream.Write doesn't perform its write
downstream from my client program until the network stream is closed.
I then see the data that was sent appear on the other side.
I am sending a small amound of data and read where data wasn't sent
until the buffer reached a larger size. However, there is a
TcpClient property call NoDelay that is suppose to eliminate this
delay. Here is a snippet of my code below. Can anyone think of a
reason why the networkStream.Write isn't performed until the
networkstream is closed?
Dim tcpClient As New System.Net.Sockets.TcpClient()
tcpClient.Connect("i set ip here", "and port here")
//connection occurs as expected
tcpClient.NoDelay() = True
Dim networkStream As NetworkStream = tcpClient.GetStream()
Dim sendBytes As [Byte]() = Encoding.ASCII.GetBytes("test")
If NetworkStream.CanWrite And NetworkStream.CanRead Then
' Do a simple write.
networkStream.Write(sendBytes, 0, sendBytes.Length)
//this .write is returned but the data is not sent until a
networkstream.close is performed
*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
downstream from my client program until the network stream is closed.
I then see the data that was sent appear on the other side.
I am sending a small amound of data and read where data wasn't sent
until the buffer reached a larger size. However, there is a
TcpClient property call NoDelay that is suppose to eliminate this
delay. Here is a snippet of my code below. Can anyone think of a
reason why the networkStream.Write isn't performed until the
networkstream is closed?
Dim tcpClient As New System.Net.Sockets.TcpClient()
tcpClient.Connect("i set ip here", "and port here")
//connection occurs as expected
tcpClient.NoDelay() = True
Dim networkStream As NetworkStream = tcpClient.GetStream()
Dim sendBytes As [Byte]() = Encoding.ASCII.GetBytes("test")
If NetworkStream.CanWrite And NetworkStream.CanRead Then
' Do a simple write.
networkStream.Write(sendBytes, 0, sendBytes.Length)
//this .write is returned but the data is not sent until a
networkstream.close is performed
*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*