question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support multiple hosts

See original GitHub issue

Hi,

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:closed
  • Created 3 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kerryjiangcommented, Jun 28, 2020

I did an enhancement about it. Check out the new added test case in the main test.

image

1reaction
markgouldcommented, Jun 9, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found