asynchronous

Writing a topic pub/sub system

I am writing a client/server application that will publish and subscribe to topics. I have few questions about the architecture and the implementation for this project. First to setup the basis i will use c# ( .NET 3.5 ) and i want to explicitly use raw Sockets/AIO/Threads(No WCF at first as i do want to fine tune the server and clien...

Does Java not do things asynchronously?

I am trying to learn Java, I was reading a tutorial that said something like this: while (N <= 0) { TextIO.put("The starting point must be positive. Please try again: "); N = TextIO.getlnInt(); } It seems like when you ask the user for input it suspends until the response is recieved? I am used to these t...

How to keep asynchronous parallel program code manageable (for example in C++)

I am currently working on a server application that needs to control a collection devices over a network. Because of this, we need to do a lot of parallel programming. Over time, I have learned that there are three approaches to communication between processing entities (threads/processes/applications). Regrettably, all three approaches ...

Stacking and delaying multiple UI change notifications

Did anyone handle such scenario in the code? User is typing something in the input area (say, rich text box). This causes multiple TextChanged events to fire. We want to capture only last changed event when user stops typing (i.e.: no changed events for 5 seconds). Does anyone have a clean C# snippet of doing that? ...

sql async query problem....

So, why doesn't this ever make it to the callback function? using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data.SqlClient; namespace sqlAsyncTesting { public partial class Form1 : F...

What is AsyncCallback?

Hi I have seen the AsyncCallback in many client server programs. What is the use of AsyncCallback and why should we use it? ...

Get notification when NSOperationQueue finishes all tasks

NSOperationQueue has waitUntilAllOperationsAreFinished, but I don't want to wait synchronously for it. I just want to hide progress indicator in UI when queue finishes. What's the best way to accomplish this? I can't send notifications from my NSOperations, because I don't know which one is going to be last, and [queue operations] migh...

How do I asynchronously poll a file using a flash timer without blocking the UI?

I have a flex application that repeatedly polls a remote XML file to detect changes, but I've found that once the file hits a certain size, the poll blocks the UI and makes the page unresponsive for a short time. Is there any way to ensure that the call made to the server or the event from the flash.utils.Timer class runs asynchronousl...

AsyncCallback for a thread on compact framework

I need to implement threading to improve load time in a compact framework app. I want to fire off a background thread to do some calls to an external API, while the main thread caches some forms. When the background thread is done, I need to fire off two more threads to populate a data cache. I need the background thread to be able to e...

Remote SP Call via Linked Servers. Asynchronous or not?

Hello Experts I have set up 2 servers which are linked. From my LOCAL SERVER, I am executing a SP that will be run on the REMOTE SERVER. The next part of the script requires me to INSERT DATA from the changes made via the SP on the REMOTE SERVER to the LOCAL SERVER. Therefore my question is, is this process asynchronous or synchronou...

How to set Async Page Directive Dynamically so Async Methods work

I am writing some Utility code to send off emails Async. var mailClient = new SmtpClient(smtpHost); mailClient.SendCompleted += new SendCompletedEventHandler(mailClient_SendCompleted); using (var mailMessage = new MailMessage()) { if (!((System.Web.UI.Page)HttpContext.Current.CurrentHandler).IsAsync) { // set to Async?...

how do I implement in C# a method that returns only when some user event happens?

what I am getting at is something like OpenFileDialog.Show() method that returns after indefinite amount of time, only after user does something (presses Ok in this case). Well, I know that I can achieve similar things for dialog controls by subclassing from dialog, or form, or something like that. But what if I want to do it for somethi...

Deadlock when closing thread

I created a class that opens a COM port and handles overlapped read and write operations. It contains two independent threads - one that reads and one that writes data. Both of them call OnXXX procedures (eg OnRead or OnWrite) notifying about finished read or write operation. The following is a short example of the idea how the threads...

boost::asio: How do I use async_accept to accept incoming connections?

I'm using boost::asio, and I have code like this: void CServer::Start(int port) { tcp::acceptor acceptor(m_IoService, tcp::endpoint(tcp::v4(), port)); for ( ;; ) { shared_ptr<tcp::socket> pSocket(new tcp::socket(m_IoService)); acceptor.accept(*pSocket); HandleRequest(pSocket); } } This code works, bu...

Phusion Passenger + Workling + RabbitMQ

Hi everyone, I am trying to deploy a RoR app that does some asynchronous task. I use workling for that and the message queue is RabbitMQ. This combination worked flawlessly with Starling but we decided to change the MQ for Rabbit. I read somewhere that I should include the following code in my environment.rb require 'mq' if defined?(P...

WPF ObjectDataProvider IsAsynchronous Complete and conditional databinding

Kind of a two part question... first let me explain what I am trying to accomplish. I have a basic window that is laid out as follows Server (combobox) that pulls a list of sql servers: <ObjectDataProvider x:Key="SQLServerList" ObjectInstance="{x:Static data:Sql.SqlDataSourceEnumerator.Instance}" MethodName="GetDataSources" IsAsynchro...

Is Socket.BeginReceive(IList<ArraySegment<byte>> buffers.. Not Asynchronous?

Hi all, I have been looking to implement a custom class of : IList<ArraySegment<byte>> this will be passed to a socket, and used as the buffer to receive data from that Socket. Socket.BeginReceive( IList<ArraySegment<Byte>>, SocketFlags, AsyncCallback, Object ) MSDN Documentation While testing I have found that when calli...

Silverlight 2 How to know all ASYNC WCF calls has been completed

Tools : SilverLight 2, C# 3.5, VS2008 and WCF Async Programming In my SL2 application, I am making 3 async wcf calls as follows - void HomeScreen() { //Async WCF Calls DataService.GetPersonInfo(sUser); DataService.GetSalaryInfo(sUser); DataService.GetDepartmentInfo(sUser); //Where to put this code? //Page.Redirect("MainScreen"); } ...

Most Concise way to Invoke a void Method Asynchronously

Hi all, I have a method which I would like to invoke asynchronously: void Foo() { } I can indeed invoke this asynchronously by the following: delegate void DVoidMethod(); DVoidMethod FooDelegate = new DVoidMethod(Foo); FooDelegate.BeginInvoke(null,null); Has anyone got any alternatives? I think three lines of code is too much? ...

How can a web application synch a folder of text files on the client's PC?

I want to be able to synchronize several text files on a user's PC in real time from my web application. Basically I want a few data files on the local PC to mirror the state of a user's data in my web application so if the web application or the user's internet connection is lost he can use those data files to get some critical info (p...