public void Stop() { // Stop the keepalive timer if (keepalive_timer != null) { keepalive_timer.Stop(); keepalive_timer = null; } if (rtsp_client == null) { return; } // Send TEARDOWN var teardown_message = new RtspRequestTeardown { RtspUri = new Uri(Url), Session = RtspSession }; if (auth_type != null) { AddAuthorization(teardown_message, Username, Password, auth_type, realm, nonce, Url); } rtsp_client.SendMessage(teardown_message); // Drop the RTSP session rtsp_client.Stop(); }
private void RTSP_ProcessTeardownRequest(RtspRequestTeardown message, RtspListener listener) { if (message.Session == _videoSessionId) // SHOULD HAVE AN AUDIO TEARDOWN AS WELL { // If this is UDP, close the transport // For TCP there is no transport to close (as RTP packets were interleaved into the RTSP connection) Rtsp.Messages.RtspResponse teardown_response = message.CreateResponse(_logger); listener.SendMessage(teardown_response); CloseConnection("teardown"); } }
internal RtspResponse HandleTeardown(RtspRequestTeardown request) { Contract.Requires(request != null); Contract.Ensures(Contract.Result <RtspResponse>() != null); var response = request.CreateResponse(); RtspPushDescription description; if (!PushDescriptions.TryGetValue(request.RtspUri.AbsolutePath, out description)) { response.ReturnCode = 404; return(response); } description.Stop(request.Session); return(response); }
public void Stop() { if (rtspListener != null) { RtspRequest teardownMessage = new RtspRequestTeardown { RtspUri = new Uri(url), Session = session }; rtspListener.SendMessage(teardownMessage); } // clear up any UDP sockets udpPair?.Stop(); // Stop the keepalive timer timer?.Dispose(); // Drop the RTSP session rtspListener?.Stop(); }