Closed 2576168920 closed 2 years ago
Can not reproduce this issue, please try again with the following code, and don't forget to take a screenshot
Func<IAppSession, StringPackageInfo, ValueTask> packageHandler = async (session, package) =>
{
try
{
var result = 0;
await session.SendAsync(Encoding.UTF8.GetBytes(result.ToString() + "\r\n"));
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
};
var host = SuperSocketHostBuilder.Create<StringPackageInfo, CommandLinePipelineFilter>()
.UseUdp()
.UsePackageHandler(packageHandler)
.ConfigureSuperSocket(options =>
{
options.Name = "Echo Server";
options.Listeners = new List<ListenOptions> {
new ListenOptions
{
Ip = "Any",
Port = 2012
}
};
})
.Build();
await host.RunAsync();
@2576168920 Please report this issue here, https://developercommunity.visualstudio.com/t/memory-could-not-be-read/720186 It's not the problem of SuperSocket, what's the visual studio version you are using?
I am using vs 2022 with verison 17.3 which works fine with above code. C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\devenv.exe
I suggest you Google with "devenv.exe The memory could not be read" first. You will get something like this https://developercommunity.visualstudio.com/t/vs2019-crashes-at-breakpoint/714437
奇怪的问题,tcp就没问题udp才有这问题,谢谢