Socket.Send timeout exception

I’m having an issue with socket.send since the non blocking socket changes went in. If I call socket.send too quickly (eg: calling send from a UART data received event handler or a buffer management loop) then the first send works, but subsequent sends throw with ‘Socket send timeout’.

If you add a delay (manually break after the send, or block after the send call using socket.poll) then repeated sends work fine.

Is there something going on with the non blocking sends where calling send before a previous send completes behind the scenes is blowing up, or am I missing something?

Thanks!

1 Like

Could you please send us a simple small project.

Was this ever resolved?
I’m experiencing a similar issue where many rapid UART events that invoke a TCP .Send() will tend to freeze up the whole app. Adding a thread.sleep seems to fix the issue but it slows down the application a lot.

I don’t think so in next release. what value do you add to sleep?

Adding about 5-10 ms seems enough to prevent it, but when it’s sending anywhere from 10 to 30 TCP messages a second, that delay can add up quickly. I also did some more testing and added a send timeout to the TCP socket–this will throw a timeout exception and allow the application to keep going.