Connection reset by peer

Hi - I am trying to stream 24 hours of data, writing to the plot every 30 seconds. I’m able to set up a plot and stream successfully for a few hours at a time using Python script, but after a few hours i get a “Connection reset by peer” error when trying to execute the write command. I think that means the service is forcibly closing the connection. Not sure why that would be happening - am I doing something wrong?