Skip to content

Refactor RTSP server to use hosted service pattern#5

Merged
jimm98y merged 1 commit intojimm98y:mainfrom
paulomorgado:RTSPServerApp-as-worker
Jan 19, 2025
Merged

Refactor RTSP server to use hosted service pattern#5
jimm98y merged 1 commit intojimm98y:mainfrom
paulomorgado:RTSPServerApp-as-worker

Conversation

@paulomorgado
Copy link
Copy Markdown
Contributor

  • Updated Program.cs to implement Host and IHostedService, moving RTSP server initialization to RTSPServerWorker.
  • Changed project file to use Microsoft.NET.Sdk.Worker and updated package references.
  • Created RTSPServerWorker.cs to manage the RTSP server lifecycle, including configuration and logging.
  • Modified appsettings.json to nest RTSP server settings under RTSPServerApp and added a Logging section.

This helps to see the logs produced.

- Updated `Program.cs` to implement `Host` and `IHostedService`, moving RTSP server initialization to `RTSPServerWorker`.
- Changed project file to use `Microsoft.NET.Sdk.Worker` and updated package references.
- Created `RTSPServerWorker.cs` to manage the RTSP server lifecycle, including configuration and logging.
- Modified `appsettings.json` to nest RTSP server settings under `RTSPServerApp` and added a `Logging` section.
@jimm98y jimm98y merged commit 4508067 into jimm98y:main Jan 19, 2025
@jimm98y
Copy link
Copy Markdown
Owner

jimm98y commented Jan 19, 2025

Looks nice, thank you very much! Originally, the sample server was meant to be used just as a "sample code" and not really meant for production use (unlike the library), but I love how this makes it much more usable out of the box.

@paulomorgado
Copy link
Copy Markdown
Contributor Author

It's still not production ready, but useful to see what's going on, including logging.

@paulomorgado paulomorgado deleted the RTSPServerApp-as-worker branch January 20, 2025 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants