Ray
Ray

Reputation: 8881

(How) Can I use ASP.NET Core for custom TCP packet communication?

I have a dated game server with typical TCP packet protocol (length / type / data[length]), and my task is to find modern frameworks to rewrite it in.

Having written a (small) RESTish API in ASP.NET Core 2.1, I know that it provides DI / logging / configuration features which could perfectly replace similar functionality in the old server. I thought I could use ASP.NET Core, making it handle said TCP packets instead of HTTP requests.

Now I'm a bit stuck in where to start and if / how it would fit into ASP.NET Core. So far I've RTFM'ed about inner ASP.NET Core workings and found some things that confused me:

To sum it up, my research resulted in the following two questions:

Upvotes: 4

Views: 4431

Answers (1)

Ray
Ray

Reputation: 8881

After getting back to this, I realized that Project Bedrock is aiming to further generalize Kestrel to support completely custom protocols, not even limited to raw TCP. An overview / description can be found here.

The link above shows the current public state of the project on the GitHub repository with great practical examples. It seems to be planned to be integrated with whatever follows the ASP.NET Core roadmap for .NET 6, but a prerelease version compatible with .NET Core 3.1 is available and works great in my experiments. The functionality in question no longer seems to be on the roadmap.

Upvotes: 3

Related Questions