Support multiple hosts
See original GitHub issueHi,
First off, SuperSocket v2 is looking great! Especially all the support for .NET Core and the Hosted Services.
It would be nice to be able to be able to have multiple servers running in one process. Rather than your SuperSocketHostBuilder it could be refactored so you could do something like:
static async Task Main(string[] args)
{
await CreateHostBuilder(args).Build().RunAsync();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureLogging((hostCtx, loggingBuilder) =>
{
loggingBuilder.AddConsole();
})
.UseSuperSocket<TextPackageInfo>(hostBuilderContext =>
{
//Configure server 1
return new ServerOptions();
})
.UseSuperSocket<TextPackageInfo>(hostBuilderContext =>
{
//Configure server 2
return new ServerOptions();
});
I would be happy to look at this and submit a PR if you are interested?
I think it should be possible to keep all the existing functionality as is without any breaking changes.
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Amazon IVS now supports multiple hosts in live streams
Amazon Interactive Video Service (Amazon IVS) now lets developers combine video from multiple hosts into the source for a live stream.
Read more >Backend DB: Support multiple hosts for mysql and postgres
It is possible to specify multiple host components, each with an optional port component, in a single URI. A URI of the form...
Read more >Running your applications in a multiple hosts environment
To enable the multiple host support for the ITE applications, set the parameter to on: global.multiHost=on. For every ITE application, find the global....
Read more >Multiple-Host (Distributed) Systems
A multiple-host or distributed SAP HANA system is a system that is installed on more than one host. Otherwise, it is a single-host...
Read more >Enabling and adding a co-host
The host is the only user who can assign a co-host. There is no limitation on the number of co-hosts you can have...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I did an enhancement about it. Check out the new added test case in the main test.
I think they could be registered under the scope of the individual server. I’ll see if I can put together a proof of concept to see what you think.
I agree that for bigger services splitting them and using containers is probably best but for small projects sometimes that is overkill.