SuperSocket
SuperSocket copied to clipboard
在linux环境下使用UDP的command无法处理命令
在linux环境下使用UDP 的commond 无法处理命令 版本2.0.1 .net 8.0.21 系统Ubuntu / linux容器 同一套代码同一个命令,在window环境正常,在linux环境有udp连接log,但没有命令处理log
build.AddServer<StringPackageInfo, CommandLinePipelineFilter>(
builder =>
{
builder
.UseCommand((commandOptions) =>
{
commandOptions.AddCommandAssembly(this.GetType().Assembly);
})
.UseSession<CmdSession>()
.UseUdp();
}
);
public class ServerCmd : ICommand<CmdSession, StringPackageInfo>
{
public void Execute(CmdSession session, StringPackageInfo package)
{
if (string.IsNullOrEmpty(package.Body))
return;
session.Logger.LogInformation("run cmd: " + package.Body);
}
}
public class CmdSession : AppSession
{
}
It is unit test about this feature: https://github.com/kerryjiang/SuperSocket/blob/f15e45e3c4e4918d5e595cbd25df6543bd7e02e6/test/SuperSocket.Tests/CommandTest.cs#L262C9-L322C10
Check the debug logs to see if the command is discovered.
It is unit test about this feature: https://github.com/kerryjiang/SuperSocket/blob/f15e45e3c4e4918d5e595cbd25df6543bd7e02e6/test/SuperSocket.Tests/CommandTest.cs#L262C9-L322C10
Check the debug logs to see if the command is discovered.
重点在于命令同时要使用UDP