Closed 107295472 closed 6 months ago
var hostBuilder = MultipleServerHostBuilder.Create() .AddServer<SuperSocketServiceA,TextPackageInfo, LinePipelineFilter>(builder => { builder .UsePackageHandler(async (s, p) => { await s.SendAsync(Encoding.UTF8.GetBytes(p.Text + "\r\n33333333")); }) .ConfigureServerOptions((ctx, config) => { return config.GetSection("TestServer1"); }).ConfigureServices( (hostCtx, services) => { services.AddSingleton<ITest, Test>(); }); }) .AddServer<TextPackageInfo, LinePipelineFilter>(builder => { builder .ConfigureServerOptions((ctx, config) => { return config.GetSection("TestServer2"); }); }).Build(); await hostBuilder.RunAsync();
我想服务A用socket,服务B用websocket
可以做到服务A socket收到数据后,给服务B websocket发送吗
我想服务A用socket,服务B用websocket