<div dir="ltr"><p style="margin:0px;padding:0px">Hi Ross,</p><p style="margin:0px;padding:0px"><br class="gmail-Apple-interchange-newline">My RTSP client application needs to recognize disconnect event triggered from the RTSP server. But I could not find any way to get such event. By debugging I could see the disconnect event happening inside the function RTSPClient::handleResponseBytes() when the argument </p><p style="margin:0px;padding:0px">'newBytesRead' has a value of -1.</p><p style="margin:0px;padding:0px"><br></p><p style="margin:0px;padding:0px">Could you provide a virtual function so that the derived class can subclass to receive the </p><p style="margin:0px;padding:0px">disconnect event?</p><p style="margin:0px;padding:0px">The implementation may be like this:</p><p style="margin:0px;padding:0px"><br></p><p style="margin:0px;padding:0px">class RTSPClient {</p><p style="margin:0px;padding:0px"><span style="white-space:pre"> </span>...<span style="white-space:pre">  </span></p><p style="margin:0px;padding:0px">protected:</p><p style="margin:0px;padding:0px"><span style="white-space:pre">   </span>virtual void OnConnectionClose() {};</p><p style="margin:0px;padding:0px">};</p><p style="margin:0px;padding:0px"><br></p><p style="margin:0px;padding:0px">RTSPClient::handleResponseBytes(int newBytesRead)</p><p style="margin:0px;padding:0px">{</p><p style="margin:0px;padding:0px"><span style="white-space:pre">       </span>if (newBytesRead < 0) {</p><p style="margin:0px;padding:0px"><span style="white-space:pre">               </span>// likely disconnected</p><p style="margin:0px;padding:0px"><span style="white-space:pre">           </span>OnConnectionClose();</p><p style="margin:0px;padding:0px"><span style="white-space:pre">     </span>}<span style="white-space:pre">    </span></p><p style="margin:0px;padding:0px"><span style="white-space:pre"> </span>...</p><p style="margin:0px;padding:0px">}</p><p style="margin:0px;padding:0px"><br></p><p style="margin:0px;padding:0px">Thank you.</p><p style="margin:0px;padding:0px"><br></p><div><br style="color:rgb(0,0,0);font-family:Gulim,굴림,Arial,Tahoma,AppleGothic,sans-serif;font-size:12px;background-color:rgb(255,255,255)"></div></div>