Open emmett-miller opened 3 years ago
I've the same problem with .NET 5.0 Worker Service
I suppose, because ExecuteAsync never hands back the control, the worker service cannot actually continue. What if you wrap that whole code in an await Task.Run(() => { ... })
?
Other option is to use Async methods of NetMQ and await the results, but that requires to set up a NetMQRuntime.
@abeham yes, await Task.Run(() => { ... })
works.
Thank you!
This issue has been automatically marked as stale because it has not had activity for 365 days. It will be closed if no further activity occurs within 56 days. Thank you for your contributions.
Environment
Expected behaviour
protected override async Task ExecuteAsync(CancellationToken stoppingToken) { using (var server = new ResponseSocket("@tcp://127.0.0.1:5556")) { var result = server.ReceiveFrameString(); // A ResponseSocket reads the request message } }
Actual behaviour
no message was received
Steps to reproduce the behaviour
send message over port 5556 using requestsocket add .net core 3.1 worker service and add code above install worker service as windows service deploy using sc.exe