Closed TGlev closed 4 months ago
could it be same as: #1015, #802 ?
Can be the same. I will try the workaround.
This prevents the system from hanging completely. But when opening a putty window, only a first NMEA sentence is received and then nothing more because the poll function will always return false.
If you don't want delay then you can try nodelay, look at // GHI added
public virtual void OpenConnection() {
while (true)
{
try
{
//Wait for a connection
Socket ClientSocket = Socket.Accept();
ClientSocket.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.NoDelay, true); // GHI added
//If we make it this far, a connection was been established!
IsConnected = true;
....
We tried and it works fine.
Another way, sender sends message to receiver and wait for the response from that receiver, before sending a new message.
As discussed over mail, sending too much TCP will hang entire system until TCP connection is dropped. Below is a sample project to reproduce the issue: https://github.com/TGlev/TCPStackGhiTest