Skip to content

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

@x0gundam1133

Description

@x0gundam1133

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

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions