asynchronous

WPF Call MessageBox.Show asynchronously

I have an object that has a timer and it throws an event when the timer reaches to 5 minutes. In this event, I call a MessageBox.Show("Something") in my MainWindow.xaml.cs. The problem is that when I call the MessageBox.Show(), the timer stops, until the user hits ok. And I need the timer to keep going even if the user hasn't clicked ok...

Boost asio async vs blocking reads, udp speed/quality

I have a quick and dirty proof of concept app that I wrote in C# that reads high data rate multicast UDP packets from the network. For various reasons the full implementation will be written in C++ and I am considering using boost asio. The C# version used a thread to receive the data using blocking reads. I had some problems with dro...

How to block until certain notification is posted in Cocoa?

What's the best way to sleep/wait until certain notification is posted? I've got class with asynchronous API that gets data from NSNotification (notification comes from Cocoa, I can't avoid it) and I need to unit test it. So far I've figured out semi-busy wait: [[NSRunLoop mainRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow...

C# Async socket problem

Hi everyone, I'm having a weird problem with my code, at the moment everything works fine, except the sending part. Whenever I try to send a packet it actually sends many empty packets, and I can't find out why, I've checked with the debugger and the SendPacket function is being called only once. Thanks to everyone! ...

WPF Loading animation

Hi ! I Have a ListView with many Items that is to be loaded in search. And I'd like to provide user the richer user interface so that when loading, I'd display a rotating circle (known from AJAX waiting). I realize that I'll have to go into Threads or something, but as I've never done this before in WPF, I'm sure there is something be...

How can I get non-blocking socket connect()'s?

Hello there, I have a quite simple problem here. I need to communicate with a lot of hosts simultaneously, but I do not really need any synchronization because each request is pretty self sufficient. Because of that, I chose to work with asynchronous sockets, rather than spamming threads. Now I do have a little problem: The async stuf...

AJAX callback locks the page

I have a long-running database query that I've placed in an asynchronous AJAX callback (or so I think) to allow the user to navigate to another page if they're not interested in the results. Whether I call the query automatically after page load or on click, the page always locks up until it returns, i.e links and buttons don't work. I...

Order of evaluation in JavaScript code using Ajax

It seems (to me) like javascript statements do not always run one after another. I know they do that way but sometimes it seems like a show() func tion fires at the same time with hide() so the logic fails. There are callback functions to use, like jQuery.load("some.html",thenrunthis) .. I need to understand the working logic. any help/...

[C#][WPF] How to make an asynchronous TreeView without freezing the UI ?

Hi, I would like to make a TreeView that displays servers and folders. According to my needs, I made 2 classes : -- Folder class Folder { // Hidden attributes public String ElementID { get; set; } // Attributes displayed in the treeview public String ElementName { get; set; } // This collection is binded with the...

Easiest way to make a single statement async in C#?

I've got a single statement running on a ASP.NET page that takes a long time (by long I mean 100ms, which is too long if I want this page to be lightning fast) , and I don't care when it executes as long as executes. What is the best (and hopefully easiest) way to accomplish this? ...

Can I start a thread by pressing a button in a cocoa interface and keep using interface while thread runs?

I have a Cocoa interface. When I press a button I want to process some data, but I want to keep using the interface while it's working. I guess the only solution is NSThread. Now will there be a locking mechanism preventing me from returning from an IBAction method if it spawns a thread? ...

Waiting for javascript async callback @ http post

Hi guys, I'm implementing a small feature and kind of stuck. I have a button to execute some action, such as <input type="submit" value="My Button" onclick="javascript:DoSomething();" /> When the user clicks the button the function DoSomething is called. function DoSomething() { var geocoder = new GClientGeocoder();...

Trying to understand the AsyncToken in Flex/Actionscript.

I am trying to understand the way the AsyncToken works in actionscript. How can I call a remote service and ensure that a specific parameter is available in the result or fault event functions? I think it is the async functionality I want to use. The following code will hopefully explain what I am trying to do. Feel free to modify the c...

.net async socket timeout check thread-safety

http://msdn.microsoft.com/en-us/library/system.net.sockets.socketasynceventargs.aspx Starting with the above msdn example I'm trying to write a timeout check which will close inactive client sockets and free up resources. This is what I have come up with. But I'm not sure if its completely thread-safe and if there is a better way to do...

How to use SaveFileDialog asynchronously?

Hi guys, I have a windows forms application, with a button - on the button's event handler, I need to download a file with SaveFileDialog. But I need to do this asynchronously on a separate thread. So far, I came up with this code, but I don't know if my approach is flawed or OK: private void btnDownload_Click(object sender, E...

Asynchronous method call in Python ?

I was wondering if there's any library for asynchronous method calls in Python. It would be great if you could do something like @async def longComputation(): <code> token = longComputation() token.registerCallback(callback_function) # alternative, polling while not token.finished(): doSomethingElse() if token.finished(): ...

Asynchronous HTTP requests in PHP

Is there any sane way to make a HTTP request asynchronously in PHP without throwing out the response? I.e., something similar to AJAX - the PHP script initiates the request, does it's own thing and later, when the response is received, a callback function/method or another script handles the response. One approach has crossed my mind - ...

Asynchronous Ajax call in SCORM API

I am creating a javascript API for SCORM 2004 4th Edition. For those who don't know about SCORM, basically it is an API standard that eLearning courses can use to communicate with an LMS (Learning Management System). Now the API has to have the following method: Initialize(args) GetValue(key) SetValue(key, value) Terminate(args) Comm...

Using WebClient within ASP.NET MVC asynchronously?

I have an ASP.NET MVC application that currently uses the WebClient class to make a simple call to an external web service from within a controller action. Currently I am using the DownloadString method, which runs synchronously. I have run into issues where the external web service is unresponsive, which results in my entire ASP.NET ap...

ASP.net MVC Futures AsyncController: Handling server validation

I want to be able to check the form inputs prior to launching a long running asynchronous task. Two approaches that come to mind: Check values on the Begin method and throw an exception? Post to a normal (synchronous method) which validates as per normal. redirects to the asynchonrous method if no errors found. Throwing an exceptio...