SuperSocket icon indicating copy to clipboard operation
SuperSocket copied to clipboard

在linux环境下使用UDP的command无法处理命令

Open x0gundam1133 opened this issue 3 months ago • 2 comments

在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
{

}

x0gundam1133 avatar Nov 27 '25 04:11 x0gundam1133

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.

kerryjiang avatar Dec 07 '25 01:12 kerryjiang

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

x0gundam1133 avatar Dec 22 '25 05:12 x0gundam1133