asynchronous

C++ simple asynchronous server library

Hi, Is there any c++ library that helps implementing a simple and efficient HTTP server able to handle a very large number of concurrent connections? I'd need something very similar to python's tornado, but for c++ Thanks ...

How to implement sequntial iteration with asynchronous code

I want to implement sequential upload of files (with XMLHttpRequest level2) to server. Got bunch of DOM elements with File attached (FileAPI - W3C draft). I want to upload in sequence (one after another), but XMLHttpRequest works asynchronously. Little code sample: $thumbnails = $('queue').find('.item'); for (var i = 0, len = thumbnails...

Google's GeoCode Convert City, STATE into Latitude Longitude

The following code works asynchronously. I only have it set up to convert a City, State into latitude and longitude. That value is then alerted. How can I write a function that actually returns these values? var map; var geocoder; function initialize() { geocoder = new GClientGeocoder(); } // addAddressToMap() is called when th...

Python twisted asynchronous write using deferred

With regard to the Python Twisted framework, can someone explain to me how to write asynchronously a very large data string to a consumer, say the protocol.transport object? I think what I am missing is a write(data_chunk) function that returns a Deferred. This is what I would like to do: data_block = get_lots_and_lots_data() CHUNK_SI...

WPF asynchronous invoke question.

What's wrong in my code? It's not updating the TextBox and the ProgressBar while deleting files. Imports System.Windows.Threading Imports System.IO Class MainWindow Private Sub bt_Click(ByVal sender As Object, ByVal e As RoutedEventArgs) Handles bt.Click Dim sb As New System.Text.StringBuilder Dim files = IO...

Launch process from Threadpool worker thread (and wait if needed)

I have an application that processes file transfers. In some instances, I need to launch some pre/post processing executables that do stuff with the files. So the order of events (in brief) would be like this: Worker thread is created Worker realizes it needs to launch a pre-process executable before starting the transfer Pre-process...

.NET asynchronous delegates and object instance members

In using .NET asynchronous delegates for the first time, I was surprised to empirically discover that when changing an instance member value (e.g. an int) in the asynch method (running in the new thread), the value of the instance member running in the original thread was also changed. I thought that when a new thread is created, instan...

WebClient.DownloadDataAsync SocketException crashing my app

I've got the following code to download a binary file from the web: WebClient client = new WebClient(); client.DownloadDataCompleted += new DownloadDataCompletedEventHandler(DownloadDataCompleted); client.DownloadDataAsync(uri); All works well until the connection is severed. If I disable my wireless, the app crashes out: System::Win...

C# Synchronization

I have a question about synchronisation: private void ProcessStuff(Task sometask, Form progressform) { if (sometask.foo == "A") DoStuff(); //This one is SYNchronous else { ThirdPartyObject Q = new ThirdPartyObject(); Q.ProgessChanged += delegate(object sender, ProgressChangedEventArgs e) { ...

Making an async call from an ASP.Net page-- recommended ways?

Hi everyone, We'd like to track who's on our website and what pages they're looking at. The plan is to create a delegate (which will log visits to a database table) and call it asynchronously. We're using .Net 3.5 and I don't know if the delegate idea, along with BeginInvoke and EndInvoke, is the way to go these days or if there are...

C# Asynchronous WebRequest with POST

I am trying to find a C# Asynchronous WebRequest function which will be able to POST variables to a server, and retrieve the response. I have found many Async WebRequests for C#, but they are not able to POST in them, and when I try to change them to post variables, it will not work. Cheers ...

Polling Vs AsyncCallback callbacks - best approach for a slow web service?

I have a webpage that uses AJAX to get search results for a page. On the server side I am querying a web service that is very slow - 20 seconds to 2 minutes. As I understand it, my options are either polling or having a long running request. AsyncCallback seems to be ideal since the result would be returned as soon as the web service r...

WCF Client: Can asynchronous methods be invoked at the same time?

Hi, I have a WCF service that provides a couple of methods. A Windows Forms client needs to call these methods regularly to update its display. One method returns the current service status, the other method returns the current server configuration options. The status is obtained every 2 seconds, the configuration is obtained every 10 ...

SendToAsync memory leak?

I have a simple .net 3.5sp1 windows application (in C#) that acts as a UDP server. It listens on a port, receives data from an endpoint, and then retransmits what it receives to another endpoint (i.e. a relay, for a live broadcast data stream). What I'm experiencing is after the connection is up for about 20 minutes, it starts to deteri...

WCF - Composite IAsyncResult

I have a WCF service that I want to use the async pattern on as it mainly calls a series of web services and then processes the results once all of the web service calls have returned. However, the async pattern in WCF only supports a single IAsyncResult being returned in the BeginXXX method. I was wondering if anyone had any experienc...

Dispatcher.Invoke with anonymous delegate works in Silverlight but not WPF

In Silverlight 4 I have a custom service class which has an asynchronous Completed event. Inside the Completed event I take the returned data and invoke a populate method via something like this: private void service_Completed(object sender, CompletedEventArgs args) { Dispatcher.BeginInvoke(() => populateInbox(args.Jobs)); } priva...

Asynchronous call of a SQL Server stored procedure in C#

Is it possible to call a SQL Server stored procedure asynchronously via C#? I have a stored procedure which writes a backup of a specific database (this can takes a longer time) and I want to show the progress of the backup process in a windows forms (for this I use http://www.wisesoft.co.uk/articles/tsql_backup_restore_progress.aspx)....

Invoke asynchronous method call from ASP.NET

I'm currently working on a web site which involves a data upload process. The file is currently uploaded to the server method is called (in app_code) where ultimately a DTS package is called (via a web method) to load the data into a database and perform some validation on it. The client has specified that they don't want to have to wai...

How to elegantly access Android Views from other thread?

I'm using Twitter4j in asynchronous mode. When I get response in Listener I want to be able to change some Views in my Activity but it results in CalledFromWrongThreadException. I know that I can use runOnUiThread method, but what is the most elegant solution for this apart from inlining Runnable Classes? Part of my Activity: Twi...

Loading and Deleting Remote Data From The Same View Controller

Hello, Sorry if this question has all ready been asked, maybe someone can point me in the right direction, I had trouble formatting it. I have a view controller, when it appears an NSURLConnection loads remote data asynchronously from a server into a table view, similar to how the Mail application loads data. However I also want to be...