public override void Stop() { try { if (_rtspServer != null) { _rtspServer.Stop(); } if (_httpServer != null) { _httpServer.Stop(); } if (_dataSourcesManager != null) { _dataSourcesManager.Close(); } if (_sourcesManager != null) { _sourcesManager.Shutdown(); } } catch (Exception e) { LOG.Error(e, "Caught exception while stopping facial detection agent"); } }
private void btnServerStop_Click(object sender, EventArgs e) { _server.Stop(); _server.Dispose(); if (_server.IsDisposed) { txbServerStatus.Text = "Server is shut down."; } }
public void Dispose() { Client?.Close(); _server?.Stop(); while (!NetworkUnil.IsTcpPortAvailable(ServerPort)) { Thread.Sleep(1000); } }
public void Dispose() { if (_rtspServer != null && _rtspServer.IsRunning) { _rtspServer.Stop(); _rtspServer.Dispose(); } _rtspServer = null; _media?.Dispose(); _media = null; _writer?.Dispose(); _writer = null; }
public static void Main() { //Create the server optionally specifying the port to listen on using (RtspServer server = new RtspServer(IPAddress.Any, 554)) { server.Logger = new RtspServerConsoleLogger(); //Create a stream which will be exposed under the name Uri rtsp://localhost/live/RtspSourceTest //From the RtspSource rtsp://1.2.3.4/mpeg4/media.amp RtspSource source = new RtspSource("RtspSourceTest", "rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov"); //If the stream had a username and password //source.Client.Credential = new System.Net.NetworkCredential("user", "password"); //If you wanted to password protect the stream //source.RtspCredential = new System.Net.NetworkCredential("username", "password"); //Add the stream to the server server.TryAddMedia(source); //server.TryAddRequestHandler(RtspMethod.OPTIONS,) //Start the server and underlying streams server.Start(); Console.WriteLine("Waiting for source..."); while (source.Ready == false) { Thread.Sleep(10); } Console.WriteLine("Source Ready..."); Console.ReadKey(); server.Stop(); } }