title: How to solve: UDP send of xxx bytes failed with error 11 in Ubuntu?
body: <p><strong>UDP send of XXXX bytes failed with error 11</strong></p>
  
  <p>I am running a WebRTC streaming app on Ubuntu 16.04.
  It streams video and audio from Logitec HD Webcam c930e within an Electronjs Desktop App.</p>
  
  <p>It all works fine and smooth running on my other machine Macbook Pro. But on my Ubuntu machine I receive errors after 10-20 seconds when the peer connection is established:</p>
  
  <pre><code>[2743:0513/193817.691636:ERROR:stunport.cc(282)] Jingle:Port[0xa5faa3df800:audio:1:0:local:Net[wlx0013ef503b67:192.168.0.x/24:Wifi]]: UDP send of 1019 bytes failed with error 11
  [2743:0513/193817.691775:ERROR:stunport.cc(282)] Jingle:Port[0xa5faa3df800:audio:1:0:local:Net[wlx0013ef503b67:192.168.0.x/24:Wifi]]: UDP send of 1020 bytes failed with error 11
  [2743:0513/193817.696615:ERROR:stunport.cc(282)] Jingle:Port[0xa5faa3df800:audio:1:0:local:Net[wlx0013ef503b67:192.168.0.x/24:Wifi]]: UDP send of 1020 bytes failed with error 11
  [2743:0513/193817.696777:ERROR:stunport.cc(282)] Jingle:Port[0xa5faa3df800:audio:1:0:local:Net[wlx0013ef503b67:192.168.0.x/24:Wifi]]: UDP send of 1020 bytes failed with error 11
  [2743:0513/193817.712369:ERROR:stunport.cc(282)] Jingle:Port[0xa5faa3df800:audio:1:0:local:Net[wlx0013ef503b67:192.168.0.x/24:Wifi]]: UDP send of 1029 bytes failed with error 11
  [2743:0513/193817.712952:ERROR:stunport.cc(282)] Jingle:Port[0xa5faa3df800:audio:1:0:local:Net[wlx0013ef503b67:192.168.0.x/24:Wifi]]: UDP send of 1030 bytes failed with error 11
  [2743:0513/193817.713086:ERROR:stunport.cc(282)] Jingle:Port[0xa5faa3df800:audio:1:0:local:Net[wlx0013ef503b67:192.168.0.x/24:Wifi]]: UDP send of 1030 bytes failed with error 11
  [2743:0513/193817.717713:ERROR:stunport.cc(282)] Jingle:Port[0xa5faa3df800:audio:1:0:local:Net[wlx0013ef503b67:192.168.0.x/24:Wifi]]: UDP send of 1030 bytes failed with error 11 
  </code></pre>
  
  <p>==> Btw, if I do NOT stream audio, but video only. I got the same error but only with the "video" between the Log lines...</p>
  
  <p>somewhere in between the lines I also got one line that says:</p>
  
  <pre><code>[3441:0513/195919.377887:ERROR:stunport.cc(506)] sendto: [0x0000000b] Resource temporarily unavailable
  </code></pre>
  
  <p>I also looked into sysctl.conf and increased the values there. My currenct <em>sysctl.conf</em> looks like this:</p>
  
  <pre><code>fs.file-max=1048576
  fs.inotify.max_user_instances=1048576
  fs.inotify.max_user_watches=1048576
  fs.nr_open=1048576
  net.core.netdev_max_backlog=1048576
  net.core.rmem_max=16777216
  net.core.somaxconn=65535
  net.core.wmem_max=16777216
  net.ipv4.tcp_congestion_control=htcp
  net.ipv4.ip_local_port_range=1024 65535
  net.ipv4.tcp_fin_timeout=5
  net.ipv4.tcp_max_orphans=1048576
  net.ipv4.tcp_max_syn_backlog=20480
  net.ipv4.tcp_max_tw_buckets=400000
  net.ipv4.tcp_no_metrics_save=1
  net.ipv4.tcp_rmem=4096 87380 16777216
  net.ipv4.tcp_synack_retries=2
  net.ipv4.tcp_syn_retries=2
  net.ipv4.tcp_tw_recycle=1
  net.ipv4.tcp_tw_reuse=1
  net.ipv4.tcp_wmem=4096 65535 16777216
  vm.max_map_count=1048576
  vm.min_free_kbytes=65535
  vm.overcommit_memory=1
  vm.swappiness=0
  vm.vfs_cache_pressure=50
  </code></pre>
  
  <p>Like suggested here: <a href="https://gist.github.com/cdgraff/7920db287988463aafd7ea09eef6f9f0" rel="nofollow noreferrer">https://gist.github.com/cdgraff/7920db287988463aafd7ea09eef6f9f0</a></p>
  
  <p>It does not seem to help. I am still getting these errors and I experience lagging on the other side.</p>
  
  <p>Additional info: on Ubuntu the Electronjs App connects to Heroku Server (<strong>Nodejs</strong>) and the other side of the peer connection (Chrome Browser) also connects to it. Heroku Server acts as Handshaking Server to establish WebRTC connection. Both have as configuration:</p>
  
  <pre><code>{'urls': 'stun:stun1.l.google.com:19302'},
  
  {'urls': 'stun:stun2.l.google.com:19302'},
  </code></pre>
  
  <p>and also an additional Turn Server from numb.viagenie.ca</p>
  
  <p>Connection is established and within the first 10 seconds the quality is very high and there is no lagging at all. But then after 10-20 seconds there is lagging and on the Ubuntu console I am getting these UDP errors.</p>
  
  <p>The PC that Ubuntu is running on:</p>
  
  <p><strong>PROCESSOR / CHIPSET</strong>:</p>
  
  <blockquote>
    <p>CPU Intel Core i3 (2nd Gen) 2310M / 2.1 GHz </p>
    
    <p>Number of Cores: Dual-Core</p>
    
    <p>Cache: 3 MB </p>
    
    <p>64-bit Computing: Yes</p>
    
    <p>Chipset Type: Mobile Intel HM65 Express</p>
  </blockquote>
  
  <p><strong>RAM</strong>:</p>
  
  <blockquote>
    <p>Memory Speed: 1333 MHz </p>
  </blockquote>
  
  <p>Memory Specification Compliance: PC3-10600</p>
  
  <blockquote>
    <p>Technology: DDR3 SDRAM </p>
    
    <p>Installed Size: 4 GB</p>
    
    <p>Rated Memory Speed: 1333 MHz</p>
  </blockquote>
  
  <p><strong>Graphics</strong></p>
  
  <blockquote>
    <p>Graphics Processor Intel HD Graphics 3000</p>
  </blockquote>
  
  <p>Could please anyone give me some hints or anything that could solve this problem? </p>
  
  <p>Thank you</p>
  
  <p>==============EDIT=============</p>
  
  <p>I found in my very large strace log somewhere these two lines:</p>
  
  <pre><code>7671  sendmsg(17, {msg_name(0)=NULL, msg_iov(1)=[{"CHILD_PING\0", 11}], msg_controllen=0, msg_flags=0}, MSG_NOSIGNAL) = 11
  
  7661  &lt;... recvmsg resumed&gt; {msg_name(0)=NULL, msg_iov(1)=[{"CHILD_PING\0", 12}], msg_controllen=32, [{cmsg_len=28, cmsg_level=SOL_SOCKET, cmsg_type=SCM_CREDENTIALS, {pid=7671, uid=0, gid=0}}], msg_flags=0}, 0) = 11
  </code></pre>
  
  <p>On top of that, somewhere near when the error happens (at the end of the log file, just before I quit the application) I see in the log file the following:</p>
  
  <p><a href="https://gist.github.com/Mcdane/2342d26923e554483237faf02cc7cfad" rel="nofollow noreferrer">https://gist.github.com/Mcdane/2342d26923e554483237faf02cc7cfad</a></p>