I have a Forms app and a Console server app connected with TCPClient. The Forms app opens up a dialog for user authentication, when user clicks the Login button, a request is sent to the server. The server then responds if the login credentials were…
I've read many previous posts on multithreading in .NET, and tried a number of approaches but I'm struggling to get my specific case and c#.NET code to behave. My code is designed to run long-running processes in the background and report ongoing…
How do scope and synchronization context relate?
With regards to this Search() method running in our WPF GUI thread:
private void Search()
{
const int CPUs = 2;
var doneEvents = new ManualResetEvent[CPUs];
// Configure and launch…
From this answer from Stephen Cleary, I understand that the HttpContext flows with the SynchronizationContext. Therefore, given the following piece of code:
public async Task Index()
{
var outerContext =…
Client starts some action via button. In controller its async method: async public Task CreatePresentation that contains line using (var response = await client.SendAsync(request).ConfigureAwait(false)). Lets say this line takes 10s to…
I am working on the migration from SQLite/WebApis to Realms in an App in Xamarin Forms.
This application manages a messaging service (Chat through SignalR).
The problem that has arisen is when a message is received, which I try to store in a…
I'm developing an web API using CQRS pattern. I have a command to Create Author.
Here is my Command Handler:
internal sealed class AddCommandHandler : ICommandHandler
{
private readonly IUnitOfWork _unitOfWork;
…
I try to collect the real time output from "public async Task RunProcessAsync()" and send to Form1 via "synchronizationContext.Post()" and "progress.Report()" to process there, for debug purpose, timestamps are added both in the output and received…
I have a scenario where I am using a notification event in my client in the setup code is very simple as follows. This is a AspNet Mvc 4.72 client that uses AspNetCore IdentityServer4:
app.UseOpenIdConnectAuthentication(new…
On legacy ASP.NET, the continuation of asynchronous method is queued to the request context (AspNetSynchronizationContext). But on ASP.NET Core, there is no such a SynchronizationContext (contextless).
So, where are asynchronous continuations…
In my Asp.Net WebApi controller (framework version 4.6.1) I have the following code:
[Route("async_test_2")]
public async Task AsyncTest2()
{
TelemetryDebugWriter.IsTracingDisabled = true;
var…
I want to optimize My server side speed and performance to manage clients, I think I have two way to mange them:
1.Create manually one thread per client connection
2.create SynchronizationContext per client (this will manage threads on…
My question has changed now: I am looking for a "correct" pattern to be able to store a SynchronizationContext or something else in the view model; so that I can marshall external invokers back onto the window's thread.
My goal:
Get a platform…
I'm creating a WinForms app with picture boxes which are disabled and not visible by default. When I click on a radio button in my form, I want the picture boxes to appear and immediately after that I want something to be drawn over them:
// the…