Hi guys, I wrote Vb.net code for controlling a robot which communicated using ethernet. everything is working fine but after a while (about 6-7hours) it looses communication probably due to buffer memory or something getting full and it throws following error-Unable to read data from the transport connection: An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full.
So how do I increase buffer memory or how do I get it empty regularly so connection always stays active. I'm using below code for streaming data-
_tcpClient = New System.Net.Sockets.TcpClient()
_tcpClient.Connect("193.240.200.203", 10001)
_tcpStream = _tcpClient.GetStream()
_tcpStream.BeginRead(_readBuffer, 0, 256, New AsyncCallback(AddressOf OnDataAvailable), Nothing)
Thanks in advance, any help much appreciated.
What I have tried:
I was thinking to increase read buffer size from 256 to 1024 and see if it works but haven't got it done yet.
_tcpStream.BeginRead(_readBuffer, 0, 1024, New AsyncCallback(AddressOf OnDataAvailable), Nothing)