title: libcurl rtsp keep alive with rtsp server
body: <p>I was implementing rtsp with libcurl(sample code <a href="https://curl.haxx.se/libcurl/c/rtsp.html" rel="nofollow">https://curl.haxx.se/libcurl/c/rtsp.html</a>) 
  I received RTP data after sending PLAY option.
  But the connection broke about ten minutes.
  I thought it might send heartbeat message to rtsp sever to keep session alive.</p>
  
  <p>How to keep connection alive with libcurl ?   </p>
  
  <p>Code Flow :</p>
  
  <pre><code>// Set Option
  
  // Set Describe
  
  // Set Setup
  
  // PLAY
  
  /* Receive RTP DATA*/
  
  while(1)
  
  {
  
  curl_easy_set_opt(curl, CURLOPT_WRITEFUNCTION, rtsp_write);
  
  curl_easy_set_opt(curl, CURLOPT_WRITEDATA, NULL);
  
  .....
  
  }
  </code></pre>