diff --git a/samples/CommandServer/ADD.cs b/samples/CommandServer/ADD.cs index 09d9c0387..7f3a1662c 100644 --- a/samples/CommandServer/ADD.cs +++ b/samples/CommandServer/ADD.cs @@ -18,7 +18,7 @@ public async ValueTask ExecuteAsync(IAppSession session, StringPackageInfo packa .Select(p => int.Parse(p)) .Sum(); - await session.SendAsync(Encoding.UTF8.GetBytes(result.ToString() + "\r\n")); + await session.SendAsync(Encoding.UTF8.GetBytes(result.ToString() + "\r\n"), cancellationToken); } } } diff --git a/samples/CommandServer/MULT.cs b/samples/CommandServer/MULT.cs index 3a6905e51..7ed5a6f6e 100644 --- a/samples/CommandServer/MULT.cs +++ b/samples/CommandServer/MULT.cs @@ -19,7 +19,7 @@ public async ValueTask ExecuteAsync(IAppSession session, StringPackageInfo packa .Select(p => int.Parse(p)) .Aggregate((x, y) => x * y); - await session.SendAsync(Encoding.UTF8.GetBytes(result.ToString() + "\r\n")); + await session.SendAsync(Encoding.UTF8.GetBytes(result.ToString() + "\r\n"), cancellationToken); } } } diff --git a/samples/CommandServer/SUB.cs b/samples/CommandServer/SUB.cs index 39f35460b..83d3a96d3 100644 --- a/samples/CommandServer/SUB.cs +++ b/samples/CommandServer/SUB.cs @@ -21,7 +21,7 @@ public async ValueTask ExecuteAsync(IAppSession session, StringPackageInfo packa .Select(p => int.Parse(p)) .Aggregate((x, y) => x - y); - await session.SendAsync(Encoding.UTF8.GetBytes(result.ToString() + "\r\n")); + await session.SendAsync(Encoding.UTF8.GetBytes(result.ToString() + "\r\n"), cancellationToken); } } } diff --git a/test/SuperSocket.Tests.Command/MIN.cs b/test/SuperSocket.Tests.Command/MIN.cs index 0637027fe..d4e7e5778 100644 --- a/test/SuperSocket.Tests.Command/MIN.cs +++ b/test/SuperSocket.Tests.Command/MIN.cs @@ -17,7 +17,7 @@ public async ValueTask ExecuteAsync(IAppSession session, StringPackageInfo packa var result = package.Parameters .Select(p => int.Parse(p)).OrderBy(x => x).FirstOrDefault(); - await session.SendAsync(Encoding.UTF8.GetBytes(result.ToString() + "\r\n")); + await session.SendAsync(Encoding.UTF8.GetBytes(result.ToString() + "\r\n"), cancellationToken); } } } diff --git a/test/SuperSocket.Tests.Command/SORT.cs b/test/SuperSocket.Tests.Command/SORT.cs index d56305c9b..f716a7466 100644 --- a/test/SuperSocket.Tests.Command/SORT.cs +++ b/test/SuperSocket.Tests.Command/SORT.cs @@ -16,7 +16,7 @@ public async ValueTask ExecuteAsync(IAppSession session, StringPackageInfo packa var result = string.Join(' ', package.Parameters .Select(p => int.Parse(p)).OrderBy(x => x).Select(x => x.ToString())); - await session.SendAsync(Encoding.UTF8.GetBytes($"{nameof(SORT)} {result}\r\n")); + await session.SendAsync(Encoding.UTF8.GetBytes($"{nameof(SORT)} {result}\r\n"), cancellationToken); } } } diff --git a/test/SuperSocket.Tests/Commands.cs b/test/SuperSocket.Tests/Commands.cs index 18e130956..73407b46a 100644 --- a/test/SuperSocket.Tests/Commands.cs +++ b/test/SuperSocket.Tests/Commands.cs @@ -82,7 +82,7 @@ public async ValueTask ExecuteAsync(MySession session, StringPackageInfo package var socketSession = session as IAppSession; // encode the text message by encoder - await socketSession.SendAsync(_encoder, result.ToString() + "\r\n"); + await socketSession.SendAsync(_encoder, result.ToString() + "\r\n", cancellationToken); } } @@ -96,7 +96,7 @@ public class POW : JsonAsyncCommand { protected override async ValueTask ExecuteJsonAsync(IAppSession session, PowData data, CancellationToken cancellationToken) { - await session.SendAsync(Encoding.UTF8.GetBytes($"{Math.Pow(data.X, data.Y)}\r\n")); + await session.SendAsync(Encoding.UTF8.GetBytes($"{Math.Pow(data.X, data.Y)}\r\n"), cancellationToken); } } @@ -110,7 +110,7 @@ public class MAX : JsonAsyncCommand protected override async ValueTask ExecuteJsonAsync(IAppSession session, MaxData data, CancellationToken cancellationToken) { var maxValue = data.Numbers.OrderByDescending(i => i).FirstOrDefault(); - await session.SendAsync(Encoding.UTF8.GetBytes($"{maxValue}\r\n")); + await session.SendAsync(Encoding.UTF8.GetBytes($"{maxValue}\r\n"), cancellationToken); } } } \ No newline at end of file