0

I have a python program that continuously reads radar data from 8 different radars in the network, parses the data and writes them in JSON files. Back when I was working with just 1 radar, the flow of data I would receive in my python program looked much faster than when I am working with 8 radars. What I mean by this is (I am going to give random numbers for the sake of explaining) when I worked with 1 radar, I would read 10 sentences from the radar per second whereas now that I work with 8 radars, I read about 2 sentences from each radar per second. I read data from radars in a much slower manner since parsing and writing takes time and there's more radars to work with. So I definitely parse and write the data at a slower pace than it gets created and sent through the network. That means that at some point my socket buffer will overflow, right? Is there a way to check if it ever overflows? And if it does, how can I fix this problem? Would I need a virtual machine per 'x' number of radars? Are there other fixes?

Thanks.

Rony Azrak
  • 527
  • 2
  • 6
  • 16
  • see https://stackoverflow.com/questions/20939299/does-python-support-multithreading-can-it-speed-up-execution-time – turbulencetoo Jun 19 '17 at 18:23
  • Are you using SOCK_STREAM? If so, and if you correctly check for error conditions when you perform socket operations, then you will either receive all the data that was sent or you will get an error indication. – President James K. Polk Jun 19 '17 at 19:13
  • @JamesKPolk I don't know about SOCK_STREAM. I'm using sock.recv. I do receive data and it works fine, it's just that this is a program I am going to run continuously with no pause, so I feel like the socket buffer is bound to get overwritten. Would I get an error message if that happens? – Rony Azrak Jun 19 '17 at 20:19
  • sock.recv? I don't see sock.recv. Which line is that on? – President James K. Polk Jun 19 '17 at 20:38
  • Which line? I'm not sure I understand. Are you asking me to upload my code? I use the Socket module for python. //// sock = socket.socket() //// sock.connect((..,..)) //// sock.recv() – Rony Azrak Jun 19 '17 at 20:39

0 Answers0