I'm working on a project involving decoding video from a ip camera, processing it and sending in postprocessed and encoded to jpeg throw http.
Everythink works fine until send() starts to block (call time can be between 5ms and 30s [not ms]). I'm emiting 14 chunks of jpg encoded images per second of approx 20kbytes each chunk. As I've read in the send's man page, send call may block until there's enough space in kernel buffer to store the packet complelty or partially according to send result (>0 but < than full message size). Why is the reason raspberry can't afford sending 280-300KB/s throw a single connection?
I've increased the SO_SNDBUF with setsockopt to 2MB and the problem just gets delayed a bit. Also made the socket non-blocking with ioctl but more than 50% of calls to send() return -1 due to the send buffer being full I suppose.
Any tip to handle this situation?