Click here to Skip to main content
15,891,607 members
Everything / Asynchronous

Asynchronous

asynchronous

Great Reads

by Mark Pelf
Tutorial article on Asynchronous Events invocation in C#
by Federico Alterio
Elegant replacement for awaiting a limited set of tasks
by Miguel Diaz Kusztrich
An infinite set of biological shape fractals in the complex plain
by Dev Leader
Problem with async void and a solution for it

Latest Articles

by Federico Alterio
Elegant replacement for awaiting a limited set of tasks
by Dev Leader
In this blog post, we’ll explore the concept of async lazy initialization in C#
by 1f604
Source code and explanation of my io_uring based implementation of b3sum
by Bruno van Dooren
In this article, I will explain Asynchronous Procedure Calls (APCs), their uses and their pitfalls

All Articles

Sort by Updated

Asynchronous 

26 Jul 2023 by 1f604
Source code and explanation of my io_uring based implementation of b3sum
28 Dec 2012 by _Noctis_
Hi guys, I'm trying to wrap my mind around this asynchronous and background worker stuff ...As a playground, i have a WPF application that searches for prime numbers.Basics are easy. Create bgw (my short for BackGroundWorker), create DoWork, RunWorkerCompleted, ProgressChanged delegates....
8 Dec 2019 by Abdulrahman Emad
This article proposes a solution for plugging "Rg.Plugins.Popup" asynchronous into your code.
15 Jul 2012 by abhinavashubajpai
Hi all,Active Directory provides an enterprise-level tool for organizing, managing, and locating resources in a network.my question is that how can i synchronize an active dirctory with Yammer(an enterprise internal messaging tool).if anyone know about it then please respond me soon...
13 Nov 2014 by Afzaal Ahmad Zeeshan
You will have to create a container for this method, since this method is present in a .NET library itself, you cannot edit it. You can however, create a container method and apply a few things to it. async[^] modifier is used to tell that this method is asynchronous. await[^] is used to...
18 May 2012 by aj0000
How can I populate a listview in virtual mode(I have several thousand of ListViewItem to add). I do not know how many items to be added in advance, I must add items asynchronously.I added the method 'RetrieveVirtualItem', which is: 'e.Item = listOfItems[e.ItemIndex];'Another class creates...
28 Feb 2023 by Ajay_Saini
Hi, Please clarify following problem if any solution is there - In ASP.NET i am calling 4 Web Methods in parallel using $.ajax with async=true. Now lets assume there are 4 functions that i am calling to utilize the benefit of ajax as - BindGridRecords(); BindNotifications(); BindProjectFiles();...
9 Feb 2014 by ajaytvish
I need to code a server and a client that communicates using tcp and an asynchronous communication. I wish to implement it with only the basic api's like createsocket(), listen(), connect(), bind() etc. CAsyncSocket is available but that's MFC and I am looking for basic help related windows api.....
8 Feb 2012 by aka_Rich
Hi Guys, I have some C++ code that is working in Real-Time with a decoder. Its job is to Insert into SQL 2008 R2 and its currently using ADO 2.8 to do it. However i dont want it to block while doing the Insert, because it holds up other packets arriving from the decoder. So i am trying...
9 Jan 2016 by Aldonis55
A simple WinForms example that shows one way to implement asynchronous operations in your applications
25 Nov 2015 by Amir Dashti
Simply understand what happens when you use async/await keywords, what are the benefits and how to prevent deadlocks
21 Mar 2019 by Amod Kumar Chandra
I am facing following issue NETSDK1064 Package AsyncUsageAnalyzers, version 1.0.0-alpha003 was not found. It might have been deleted since NuGet restore. Otherwise, NuGet restore might have only partially completed, which might have been due to maximum path length restrictions. Can anyone help...
23 Jun 2015 by Andy Lanng
Hi,yay - a much shorter post ^_^I posted a question where my code was giving me a "cannot access disposed object". I get why that happened now:I send of ~1000 request to the web service asynchronously.I have a Complete delegate that increments a counter for each response.Once...
12 Jul 2016 by Anisuzzaman Sumon
Dear Experts,Just let me know is the following code executed as asynchronously ?My Code is shown belowpublic class CompanyController : Controller {public delegate void CompanyAuditRecordKeeper(CompanyModel company, string operationType); public ActionResult Create(CompanyModel...
25 Jan 2013 by anshudutta
Multi-threading in .NET - A walkthrough.
26 Apr 2013 by armanr
please help me friendsi have code below:when getting to "worker = ((Service1)ar.AsyncState).EndAccept(ar);"take a error:The remote server returned an error: NotFound.or exceed...time out errorpublic MainPage() { InitializeComponent(); ...
11 Oct 2013 by ASP.NET Community
JavaScript Object Notation (JSON) is one of the core technologies used in Asynchronous JavaScript and XML (AJAX). Following links help you explore
27 Mar 2015 by ASP.NET Community
Sending e-mail is an important and common feature in ASP.NET (through the System.Net.Mail namespace). In this article, I will show how to send asynchronous mail.
18 Oct 2013 by ASP.NET Community
Improve the scalability of a website and efficient design for time consuming processes.
30 Jan 2012 by Auric Consulting, LLC
In the code below, there is a BeginRead call which I want to use in an async manner. (warning, code is cobbled together using a variety of code samples found lying around on the internet!) With this sample, I expect the BeginRead to return immediately, and then the callback to be hit later on...
3 May 2013 by ayesha hassan
I had been working on non-blocking udp socket. The code that I had developed generates a Window Message whenever there is any data to be read over the socket. Below is the code snippet:void createSocket(HWND hwnd){ ///Socket Binding/// WSADATA wsa; ///Initialise winsock/// ...
30 Dec 2014 by Babu_Abdulsalam
Various features supporting Concurrency in C++11
14 Oct 2014 by Bartlomiej Filipek
Simple introduction to std::future and std::async and why they can be useful.
17 Dec 2018 by Benktesh Sharma
Tips for tracking progress on multiple async tasks in Android
15 Apr 2014 by Bernhard Hiller
Encapsulate the parameters, the routine, and the event in a class.Your main application creates an instance of it, subscribes the event, then starts the routine Thread thread = new Thread(() => myObject.StartRoutine()); thread.Start();Note that the event is fired in a different thread than...
21 Jan 2022 by Bernhard Nebel
How does asynchronous serial communication work, what Arduino libraries are there to support it, and what can go wrong?
7 Feb 2013 by bobb024
Hello,Currently I have an FTP process that grabs as many files that exist on the specific FTP file location and then pulls them down and downloads them. Based on specs changing instead of sending multiple files they are going to send one big file. Is there any suggestions on how to pull...
1 Nov 2021 by Bohdan Stupak
Short tip explaining the importance of asynchronous communication
22 Nov 2013 by bowlturner
And why can't you just use System.Threading.Thread.Sleep(10000); in the while (!cancellationToken.IsCancellationRequested) Block?As far as how to wait for the GetRssItems you can use the ContinueWith to call a 'finish' or 'next' I have thisprivate void StartTask(long...
2 Apr 2023 by Bruno van Dooren
In this article, I will explain Asynchronous Procedure Calls (APCs), their uses and their pitfalls
17 Nov 2014 by bssrini
Browser control plays an important role in hybrid application development, when browser controls are used for a prolonged time its memory foot print starts to increase gradually. This article explains a way to host the browser control in a separate process which can be loaded/unloaded as needed.
12 Jun 2022 by canvas_newbi
I have a function that reads files in a directory and pushes their name into an array. But every time I try to print the array, it's empty because the code does not wait for the function to finish, even though I used await that suppose to make...
3 Feb 2014 by Charlesirwin1810
i am new to silverlight and wcf services, My issue is i have a silverlight application that connects to wcf service in a IIS server. on the first run i am able to get the data just like that, on subsequent calls to the same method in WCF service the response from sever is getting...
2 Jun 2015 by CHill60
1. Explanation of one-way command messaging:Start your research here[^]image to explain[^]2. Link to info on Greg's paper:on Google Groups[^]developer network[^]If nothing else posting this solution may draw someone's attention to your post to offer further information
16 May 2019 by ChimpTrader
A very simple query, your solution would help tremendously. Many thanks in advance. With the help of C++, I am trying to built a Win32 DLL Data Plugin using the instructions as mentioned in the ADK of a software (client), which is going to fetch data from TCP Socket based API and then inject...
16 Sep 2020 by Chris Copeland
I'm not particularly au fait when it comes to modern JS and the classes available to it, but if you're concerned about asynchronous web requests refreshing the token at the same time, you'd have to look into something like a Mutex. For the flow...
16 Apr 2021 by Chris_Green
Get an event fired by Thread A to execute in the context of Thread B
28 Dec 2012 by ChrisTopherus
Hi,i am writing a wpf applivation with the mvvm pattern. in my viewmodel, i receive the data asynchron over a wcf service:#region Constructionpublic AddressViewModel(){ this.LoadAddress();}private async void LoadAddress(){ ServiceClient client = new...
29 Dec 2012 by ChrisTopherus
EDIT:Sometimes you think to yourself... DOOOH :)If someone is looking for this too:http://msdn.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanged.propertychanged.aspx[^]If you update your hole object, just do RaisePropertyChanged(null); and you'll get all...
3 Jul 2012 by cognismith
I'm writing a server application which uses the .net sockets to communicate using the provided Async functionality, and I have a question regarding the reliability of the method I am using.MSDN - Socket.EndReceive Method (IAsyncResult)[^] Notes that:"All I/O initiated by a given thread is...
24 Aug 2020 by cupidanish
what is the difference between example 1 and example 2: Example 1: function a () { console.log("A is running"); b(); } function b () { console.log("B is running") } a(); Example 2: const fun1 = function a (callback) { ...
28 Dec 2015 by danah gaz
A lightweight, high performance, easy to use asynchronous stream copy method using IOCP with progress, throughput tracking, and no explicit thread creation.
19 Oct 2011 by DANAOS_master
Hi folks,we have a dashboard application that presents data according to dynamically executed SQL read from a database.Up to now application connects to the database, loops against the grids (that present data), reads their SQL source, executes the SQL, presents the results in...
17 Mar 2016 by Daniel JXHV
No more ORM, EF, A Stored Procedure direct Access framework for JavaScript.
22 Apr 2022 by Darylmo
I want to send an httpclient request asynchronously using completablefuture and also use exponential backoff and retry logic to send the message 3 times it if it fails to do it the first time. What I have tried: I haven't been able to make my...
8 Jan 2016 by Dave Kreskowiak
You mean something like this? What's better about this method is you get to handle exceptions as well as timeouts quite cleanly. private async void StartButton_Click(object sender, EventArgs e) { try { string message; ...
28 Dec 2012 by db7uk
Unfortunately yes. If you do not use something like Notify Property Weaver[^] you will need to raise the notify on each property change.If you do not go down the automated route, I would really recommend setting your property value and then raising the changed event on the property setter...
23 Mar 2017 by dell-gl62m
I have async await method in my form that I called when button1 is clicked. How do I stop the async await when I click button2?What I have tried:Private Async Sub Flash() While True Await Task.Delay(100) Label1.Visible = Not Label1.Visible End WhileEnd SubAbove code...
6 Feb 2023 by Dev Leader
Problem with async void and a solution for it
14 Aug 2023 by Dev Leader
In this blog post, we’ll explore the concept of async lazy initialization in C#
7 Nov 2016 by Dirk_Strauss
In this article by Dirk Strauss, author of the book C# Programming Cookbook, he sheds some light on how to handle events, exceptions and tasks in asynchronous programming, making your application responsive.
11 Aug 2013 by Dmitry Tretyakov
.NET library aimed for managing and querying entities from Windows Azure Storage. Contains LINQ to Azure Table provider.
25 Aug 2017 by DotNetFellow
hi I have been trying to get SqlDataReader to work using Async/Awaits but without much success. I got IEnumerable, cannot convert Task to SqlDataReader and some other errors. Here is basically my code and I must thank in advance to anybody who can really lend a hand to help out. //App_Code...
7 Jul 2014 by Eduardo Antonio Cecilio Fernandes
How to handle asynchronous tasks in Android Activities
21 Apr 2013 by Eduardo Antonio Cecilio Fernandes
Add asynchronous tasks, using threads, in Android activities while updating its progress to the UI. Use this technique for SDKs lower than 1.5.
1 Feb 2015 by Emiliarge
Comparison of 4 browser engines and controls + some tips for using them (in attached projects and in tip text). Short and clear.
8 Oct 2012 by Erick Dee
Hello all,I'm having this problem with an app I tried to deploy to IIS version 6.1. My code makes an asynchronous call (via a WebClient and delegate code) to retrieve XML data from a remote server, and this is working perfectly fine when I run the app from Visual Studio 2010. However, when I...
10 Oct 2012 by Erick Dee
Found out what the problem was. The remote server was denying me access (401) because I was sending the DefaultCredentials in the WebClient object. It turns out that they're not the same when using the ASP Development server (your Windows account) than those sent by IIS when the app is deployed,...
16 May 2014 by Erol Esen
An introduction to async functions introduced in C# 2012/2013
27 Jul 2017 by ervat
Page1.aspx.cs string strMsgID = //task1 returns a value; BackgroundJob.Enqueue(() => doLongJob(strMsgID)); public void doLongJob(string strMsgID) { int status = //task2(strMsgID); while( status == 2) { Thread.Sleep(10000); status = //task2(strMsgID); } }...
21 Oct 2011 by Ezra Neil
Reading at your question, the first thing that come to my mind is multi-threading. Backgroundworker is threading too but you cannot effectively have more than one threads at a time.Create your own threads and by doing this you can dynamically add more threads as needed. Creating own threads...
24 Aug 2020 by F-ES Sitecore
The difference is that in the first example "a" can only then go on to call "b" as the call to "b" is hard-coded in "a". In the second example the calling code decides what function "a" calls, so it could be "b", it could be "c", it could even...
18 Jul 2013 by f1194361820
use jquery framework, it can help you
12 Sep 2011 by faroukg
Hi there,I have a WCF webservice that executes a function that could take around 10 seconds to complete.The client can call the WCF web service asynchronously by either executing the WCF calls via a thread pool, or using the generated asynchronous methods. However I would like to...
17 Sep 2011 by faroukg
Hi there,I am calling a WCF service from a form. Service is hosted in IIS. The service with the following attributes: InstanceContextMode.PerSession, ConcurrencyMode = ConcurrencyMode.MultipleI have set the throttling behaviour to max out at 2000 for all concurrent calls, instances and...
4 Sep 2023 by Federico Alterio
Elegant replacement for awaiting a limited set of tasks
16 Oct 2012 by fjdiewornncalwe
1) Using your debugger, step through the code which is pinning your CPU. Find out what calls are actually the problem. Just adding a random sleep command in is like putting a band-aid on a 2 inch gash. You may appear to have solved the problem, but it won't heal the root issue.2) Once you find...
28 Mar 2013 by Florian Rappl
An introduction to async / await, popular mistakes and solutions for asynchronous programming, as well as usages and benefits from using asynchronous programming. We will also discuss interesting patterns based on concurrency.
1 Nov 2013 by Gabi Barcan
Call methods of an existing class in MFC asynchronously, while still preserving the thread affinity required by MFC and COM.
16 May 2019 by Gerry Schmitz
Test "what part"? You can "mock" anything. You should be able to abstract the "last part" to 2 or 3 lines until someone decides to "pay up". Connect; send; receive.
24 Aug 2020 by Gomehere Blogger
The callback function is important to us, Its works as an argument passing in the function. Its something required asynchronous function called and think, you need to wait for that response and want to process that response ahead that could be...
25 Aug 2017 by Graeme_Grant
Those links are one side of the solution, the other is how to handle async calls in ASP.NET Webforms. I used this search: asp.net async webforms - Google Search[^] and found these two very helpful links for you: * Using Asynchronous Methods in ASP.NET 4.5 | Microsoft Docs[^] * The Magic of...
20 Aug 2018 by Graeme_Grant
You can do it in code behind however can get messy if you have to do it for multiple controls. The answer is, where you need to use the code in more than one time, to use a behavior rather than code behind to encapsulate the code to avoid the same code in multiple places, reduces errors, and...
16 Nov 2022 by Graeme_Grant
There is a lot wrong here. 1. The method that you want to await is not marked as async 2. The asynchronous call to PerformWriteRequestAsync in method WriteMultipleCoilsAsync is not awaited. You should have: private async void...
9 Mar 2014 by hardikr.shah
Hello All,I want to use async and await in my application where I am getting PDF files from particular folder, copy into another folder, convert it into image files, perform rotation, split, merge, swapping operation on images and save the changed file in PDF through iTextSharp.Can...
30 Aug 2011 by Herman<T>.Instance
Hello everyone,Continuing my async calls I have it working in windows forms with Invoking the DataGridView.When using async dataload and databind in ASP.NET I cannot invoke the GridView component directly.When the next code is run:public partial class WebForm1 :...
1 Sep 2011 by Herman<T>.Instance
Fixed it myself!The problem was. While using the asynchronous model the page rendering was finished before the asynchronous call was finished. So when the result was there the page would have been submitted to the client!You must use the polling model to fix this problem:so my codebehind...
17 Sep 2011 by Herman<T>.Instance
Where you place null in your code (the state) you better set Proxy as value.In the EndMethod you first do:Proxy myProxy = (Proxy)ar.AsyncState; // assuming ar is declared as IASyncRestult name in methodin that case you do threadsafe asynchronous calls.
30 Jan 2012 by Herman<T>.Instance
static public void BeginAsyncReadshould bestatic public IAsyncResult BeginAsyncRead
15 Jun 2016 by HiWay International
An absolute trick to consume WCF WebService at Xamarin Form PCL root
23 Jul 2020 by honey the codewitch
Explore adapting Socket's async model to a task based one and adding some awaitable socket operations to your projects
24 Jul 2020 by honey the codewitch
Using await in scenarios where you want to await custom items with or without using Task.Run()
19 Feb 2021 by honey the codewitch
Use TaskCompletionSource to turn an event or callback based model into a Task based one
6 May 2021 by honey the codewitch
Explore the inner workings of a highly capable IoT display driver for the ESP32
18 Mar 2018 by honeyashu
In my C# code I am receiving a byte[1024] from a DLL through TCP link. Code I did for this I am attaching below. The workflow is An asynchronous packet gets received at tcp port into a byte array, which then gets copied to a different array for processing. This copied array then gets...
25 Nov 2015 by huuthai
i have same problem.please help.Without master page,it work normally,but when using master page,it work only first time,second time does not work.please help how to fixed.
20 Jan 2013 by IamBlessed
Hi guysI have a WPF application the uses the MVVM pattern, I also have a button in my WPF client application that is binded to the ICommand implementation, How do I make the UI responsive when the command is still running?Below is my code for my MVVM Implementationprivate void...
17 Dec 2013 by itskvini
Hi,I have two update panels. The first update panel has drop down list and the other has repeater control.On SelectionIndexChanged event of dropdownlist I am binding repeater, but the updation isinconsistent.Using upAgencyRatings.Update(); method in ddlCompany_SelectionIndexChanged...
9 Jan 2014 by itskvini
Well, thanks for your replies guys. Solved it using below steps -1. Removed update panel of Drop Down List.2. Added AsyncPostbackTrigger for update panel upAgencyRatings.3. Removed code upAgencyRatings.Update(); from code behind.
21 Jan 2016 by Jagbir Saini
I am working on WEB API having oracle as a back-end. I have one scenario in which I need to call one Store Procedure which is taking some time to execute. I need to to send response or some value to the UI from Service(Web API) without waiting my procedure to execute completely. I have...
19 Jul 2013 by Jason Gleim
Few things...First, please use the formatting tools when you post code. It makes it much more readable and helps those of us with old eyes like mine.Second, you have some fundamental architectural issues. You should probably move your download/status code to its own static class (module...
20 Mar 2012 by Jaxon7
Restoring UI Responsiveness FromContinuations (Asynch file IO)
5 Jan 2014 by Jayarajantk
Go here [^] for complete tutorial on ListView.WebService and AsyncTask can be found here[^].
27 Jun 2013 by Jeneesh K. Velayudhan
I have one Initialize() in my class and I am calling a delegate wrapper method from this function as follows (the call back method will call around 20 times in a sec),public Initialize(){ CX_OUTPUT_CALLBACK cb = new CX_OUTPUT_CALLBACK(OutDelegateCb); ...
28 Jun 2013 by Jeneesh K. Velayudhan
16 Sep 2020 by Jeremy D Richardson
Have a problem that I feel like must have been solved in some elegant ways but wanting some input. I'm using vanilla Javascript to solve this but wondering if perhaps there is a more elegant React solution or some other library. Problem: Have an...
7 Feb 2022 by Jim_Gray
Example code showing how to use Subtle Crypto to sign your request to Azure API in pure JavaScript or jQuery
12 Apr 2017 by Jochen Arndt
If you have a uni direction communication you can't detect such errors. All you can do on the sending side is checking for interface errors when writing to the device. But such will usually not happen with serial interfaces when the device has been opened successfully. But you may use hardware...