asynchronous

C# asynchronous socket Begin/EndReceive questions

I've implemented a async funtion in order to read large socket data, mostly files will be transferred. Code is based on this question: public class StateObject { public Socket workSocket = null; public const int BUFFER_SIZE = 1024; public byte[] buffer = new byte[BUFFER_SIZE]; public StringBuilder sb = new StringBuilder(); } public st...

DEADLOCK, EJB 3.1 with asynchronous Method and TimerService in Singleton

In my Singleton-EJB i start a TimerService every 2 minutes. When a client access the test method sometimes the application runs into a deadlock. The problem is, the test method calls a asynchronous method inside the EJB (see Method determineABC). The deadlock happens when the scheduleMethod tries to create a single action timer and there...

How do you run a synchronous timer in C#?

I am writing an app which uses a timer to display a countdown on screen to when some event happens. I want to reuse the timer, as it would be handy for a few things in the app, so I specify the words I want to wrap round the timer. For example, the following function call: CountdownTimer(90, "You have ", " until the computer reboots"); ...

Asynchronous Listening on class that launched asynchronous process

SOLVED VERSION Ok so here it is. I am not even sure how to properly ask the question. I am creating a form that pops up within a program asynchronously so that it doesn't interfere with the main program. Within this form, I want to display data that comes from the "base class", in this example, it's the Metronome class. The Metronome c...

Google Analytics: Mix asynchronous and synchronous tracking to track downloads using events

Hi, Already posted this in Google Analytics help forum, but noone could help. Hopefully I have more luck here... : I use Google Anlaytics asynchronous tracking for my pages. Works like a chram. THE PROBLEM: Recently we added event tracking to monitor how often people click on download links on our pages. I encountered a problem with Fi...

How would I organize these calls using Reactive Extensions (Rx) in Silverlight?

I have some calls that must execute sequentially. Consider an IService that has a Query and a Load method. The Query gives a list of widgets, and the load provides a "default" widget. Hence, my service looks like this. void IService.Query(Action<IEnumerable<Widget>,Exception> callback); void IService.Load(Action<Widget,Exception> callba...

Faking synchronous calls in Silverlight WP7

I'm porting some code from the full .NET framework to the WP7 version and I'm running into an issue with synchronous vs async calls. string response; string requestString = GenerateReqString(); HttpWebRequest req = (HttpWebRequest) WebRequest.Create("endpoint"); req.Method = "POST"; req.ContentType = "text/xml"; req.ContentLength...

Write to a file from multiple threads asynchronously c#

Hey all, Here is my situation. I would like to make writing to the file system as efficient as possible in my application. The app is multi-threaded and each thread can possibly write to the same file. Is there a way that I can write to the file asynchronously from each thread without having the writes in the different threads bang h...

asynchronous processing with PHP - one worker per job

Consider a PHP web application whose purpose is to accept user requests to start generic asynchronous jobs, and then create a worker process/thread to run the job. The jobs are not particularly CPU or memory intensive, but are expected to block on I/O calls fairly often. No more than one or two jobs should be started per second, but due ...

Can you switch from Async PostBack to Full PostBack in an Update Panel?

Is something like this possible? Dim iCounter as Integer Dim iQuantity as Integer = 10 Protected Sub btnFoo_Click Handles btnFoo Yadda For i as Integer = iCounter to iQuantity - 1 //do something with AsyncPostBackTrigger until iCounter = iQuantity - 1 //then trigger a full postback Next End Sub I am new to t...

F# AsyncWaitOne and AsyncReadToEnd

I am working ti old F# code from expert f#. However, the example doesn't build anymore. The following two calls don't seem to exist anymore. semaphore.AsyncWaitOne(?millisecondsTimeout=timeout) and reader.ReadToEndAsync() Does anyone know what these have been replaced with or if I am just missing a reference? ...

iPhone/Xcode giving: "Synchronous client exited with no response and no error!"

My iPhone app started displaying this in the xCode console/debugger window: Synchronous client exited with no response and no error! What does it all mean? What does it all mean? It's somehow bad to get "no error"? ...

How F#'s async really works?

I am trying to learn how async and let! work in F#. All the docs i've read seem confusing. What's the point of running an async block with Async.RunSynchronously? Is this async or sync? Looks like a contradiction. The documentation says that Async.StartImmediate runs in the current thread. If it runs in the same thread, it doesn't look...

In Silverlight, how do I handle an error during an asynchronous call?

In my SL4 app, I have a call to a service, svc.SubmitAsync(). Since this is an async call, once the method is hit, my code goes on to the next line. This is fine as long as the user enters the correct user name and password. If they don't, EndSubmit() throws an exception. EndSubmit() is in References.cs, part of the auto-generated Silver...

C# : How to capture events asynchronously and return a value from a function synchronously

This is a C# question I want to do a synchronous call for asynchronous event call backs. See comment in code for the req class User { EventHandler Service1Started() { "Looks like service 1 started as I got event from server class" ; } EventHandler Service2Started() { "Looks like service 2 started as I got...

C# Async Ping: How to avoid an out of memory exception ?

Question: I want to search the subnet for all computers in it. So I send a ping to all IP addresses in the subnet. The problem is it works fine if I only scan 192.168.0.". But if I scan 192.168..*", then I get an "Out of memory" exception. Why ? Do I have to limit the threads, or is the problem the memory consumed by new ping which do...

Dealing with Long running processes in ASP.NET

Hi, I would like to know the best way to deal with long running processes started on demand from an ASP.NET webpage. the process may consist of various steps (like upload files to the server, run SSIS packages on them, execute some stored procedures etc) and sometimes the process could take upto couple of hours to finish. if I go for asy...

Send Serialize Class with asyncronous socket

hi guys, i want to make a client - server application in c# with asyncronus socket programming and i want to send a simple image file from client to another client connected to the server. I've a serialized class that contain the property as username ecc.. and a variable in byte that containt an array of byte of image. The problem is t...

Does the SQL Server JDBC driver support asynchronous operations?

From some googling, it appears that .NET supports asynchronous operations with SQL Server 2005+. Does the latest JDBC driver support this? I can't find a mention of it anywhere, so I'm thinking it probably doesn't. But I figured it couldn't hurt to ask. Thanks! Avi ...

parts of an asynchronous httpwebrequest

There are many pieces related to an httpwebrequest that can go asynchronous. I recall reading a question here about this very topic, but I can't seem to find it any more. So I'll re-ask the question. Which of the following get the most bang for the buck (so to speak). BeginGetRequestStream/EndGetRequestStream BeginWrite/EndWrite Begin...