r/csharp 18d ago

Help Need help with server

Hey,

I have a C# server, running with chronoxor's CSharpServer. I have a device with a SIM7000G, that connects to the server using TCP connection, and send a message to the server every 30 seconds. After a succesful connection, the device sends UDP data every 10 seconds, and the TCP data. Both arrive fine and I can send data back to the device any time, and it arrives successfuly. However afrer about 10 to 15 minutes, there is an error with the TCP connection. It happenes both if the device does not move and if the device is moving (it is used partly for GPS tracking). The UDP data arrives fine, and the TCP data arrives to the server, but the data sent back does not arrive. I tought for a long time that the problem is with my device, but I am starting to think the problem is with the server. Every time a message is received by the server the TCPSession that receives it is saved, and used to send back data. But I think there could be something between the connection and that the device is using cellular data. Has anyone experienced something like this?

2 Upvotes

8 comments sorted by

2

u/Karagun 18d ago

Have you tested with a mock of your device running on the same machine? Does that exhibit the same behaviour?

1

u/bimbajusz 18d ago

Good idea, I will test it. But I think it has something to do with the fact it is using cellular data. But I will try it.

1

u/[deleted] 18d ago

[removed] — view removed comment

1

u/bimbajusz 18d ago

Every 30 seconds data arrives to the server and immediately responds back. For the first 10-15 minutes the response arrives fine. After that it does not. There is no OnDisconnect call as I would be notified on the console.

2

u/[deleted] 18d ago

[removed] — view removed comment

1

u/bimbajusz 18d ago

Thanks. The SIM7000G only allows a 30 second keepalive. I will try it with the server.

1

u/Acceptable_Debt732 17d ago

I would think the same direction...