SuperSocket icon indicating copy to clipboard operation
SuperSocket copied to clipboard

Problems:1.6.6.1 Upgrade to 2.0.0-beta.11

Open sjTwoDogSon opened this issue 2 years ago • 4 comments

1.6.6.1 version has 'InternalHandleUnknownRequest' and 'HandleUnknownRequest' in AppSession however, version 2.0.0-beta.11 does not In version 1.6.6.1, I used it to filter instructions not requested by standard protocols,is there a method similar to this in version 2.0.0-beta.11? I can't find it,I also need to record the address and SessionID of the request I hope you can help me out of your busy schedule. Thank you very much

sjTwoDogSon avatar Nov 21 '22 10:11 sjTwoDogSon

No, when get command by key failed, it will just return. https://github.com/kerryjiang/SuperSocket/blob/master/src/SuperSocket.Command/CommandMiddleware.cs#L199

protected virtual async ValueTask HandlePackage(IAppSession session, TPackageInfo package)
        {
            if (!_commands.TryGetValue(package.Key, out ICommandSet commandSet))
            {
                return;
            }

            await commandSet.ExecuteAsync(session, package);
        }

chucklu avatar Nov 22 '22 05:11 chucklu

And in v1.6 https://github.com/kerryjiang/SuperSocket/blob/v1.6/SocketBase/AppServerBase.cs#L1287

var commandProxy = GetCommandByName(requestInfo.Key);

                if (commandProxy != null)
                {}
  else
                {
                    session.InternalHandleUnknownRequest(requestInfo);
                }

chucklu avatar Nov 22 '22 06:11 chucklu

sorry, I want to directly process in the customized session. is there any good way

sjTwoDogSon avatar Nov 22 '22 07:11 sjTwoDogSon

Then you have to write your own code, as SuperSocket does not support the feature you required.

chucklu avatar Nov 22 '22 08:11 chucklu