Esempio n. 1
0
 public static ISuperSocketHostBuilder <TPackageInfo> UseCommand <TKey, TPackageInfo>(this ISuperSocketHostBuilder builder, Action <CommandOptions> configurator, IEqualityComparer <TKey> comparer)
     where TPackageInfo : class, IKeyedPackageInfo <TKey>
 {
     return(builder.UseCommand <TKey, TPackageInfo>(configurator)
            .ConfigureServices((hostCtx, services) =>
     {
         services.AddSingleton <IEqualityComparer <TKey> >(comparer);
     }) as ISuperSocketHostBuilder <TPackageInfo>);
 }
Esempio n. 2
0
 public static ISuperSocketHostBuilder <TPackageInfo> UseCommand <TPackageInfo>(this ISuperSocketHostBuilder <TPackageInfo> builder, Action <CommandOptions> configurator)
     where TPackageInfo : class
 {
     return(builder.UseCommand()
            .ConfigureServices((hostCtx, services) =>
     {
         services.Configure(configurator);
     }) as ISuperSocketHostBuilder <TPackageInfo>);
 }
Esempio n. 3
0
 public static ISuperSocketHostBuilder <WebSocketPackage> UseCommand <TPackageInfo, TPackageMapper>(this ISuperSocketHostBuilder <WebSocketPackage> builder, Action <CommandOptions> configurator)
     where TPackageInfo : class
     where TPackageMapper : class, IPackageMapper <WebSocketPackage, TPackageInfo>, new()
 {
     return(builder.UseCommand <TPackageInfo, TPackageMapper>()
            .ConfigureServices((ctx, services) =>
     {
         services.Configure(configurator);
     }) as ISuperSocketHostBuilder <WebSocketPackage>);
 }