Search Results

Search found 1382 results on 56 pages for 'async await'.

Page 7/56 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Google Analytics - async tracking with two accounts

    - by MatW
    I'm currently testing GAs new async code snippet using two different tracking codes on the same page; _gaq.push( ['_setAccount', 'UA-XXXXXXXX-1'], ['_trackPageview'], ['b._setAccount', 'UA-XXXXXXXX-2'], ['b._trackPageview'] ); Although both codes work, I've noticed that they present inconsistent results. Now, we aren't talking huge differences here, only 1 or 2 visits / day every now and then. However, this site is tiny and 1 or 2 visits equates to a 15% difference in figures. Now, the final site has much more traffic, but my concerns are; will this inconsistancy scale with traffic? assuming not, is a slight variation in recorded stats an accepted norm?

    Read the article

  • Log RuntimeException thrown from thread created by Spring via the @Async annotation

    - by Eugen
    I'm having some difficulty logging RuntimeException from a thread. My system is: Java 7 (b118), Spring 3.0.5. The threads are not created by hand, but via Spring's @Async annotation, which creates it's own executor behind the scenes, so I don't really have the option of overriding any methods of the thread, FutureTask or anything low level. So my question is if Spring has any support or if there are any best practices for handling (logging) these type of exceptions? Any suggestions are appreciated. Thanks.

    Read the article

  • C# Async call garbage collection

    - by Troy
    Hello. I am working on a Silverlight/WCF application and of course have numerous async calls throughout the Silverlight program. I was wondering on how is the best way to handle the creation of the client classes and subscribing. Specifically, if I subscribe to an event in a method, after it returns does it fall out of scope? internal MyClass { public void OnMyButtonClicked() { var wcfClient = new WcfClient(); wcfClient.SomeMethodFinished += OnMethodCompleted; wcfClient.SomeMethodAsync(); } private void OnMethodCompleted(object sender, EventArgs args) { //Do something with the result //After this method does the subscription to the event //fall out of scope for garbage collection? } } Will I run into problems if I call the function again and create another subscription? Thanks in advance to anyone who responds.

    Read the article

  • Which async call use for DB connection and still responsive GUI?--

    - by Jade
    Hi, My application connects to MSSQL but sometimes it takes a while and the GUI is getting frozen. I would like to do the connection on the other thread, I guess BeginInvoke would be the best way (I know about background worker but I would like to learn this). I have studied MSDN page but I did not understand what is the best way to use? They also say that you can use only callback when the thread that called the async.method does not need to know the results...I dont understand it as I believe I can set some variable in the other thread to "pass" the result well. I would just need the GUI to be not frozen while the connection is being established. Thank you for your advice.

    Read the article

  • Loopj Android Async Http - onFailure not fired

    - by Ashley Staggs
    I am using the great async http library from loopj, but I have run into a small snag. If the user has no internet connection or loses their connection, the app just won't return anything. This part is expected, but it also doesn't fire the onFailure method. Also, the code I have used when there is an internet connection does work so there is no problem on the server end. Here is some code that is stripped down to the minimum. It also doesn't work (I have tested this too) String url = getString(R.string.baseurl) + "/appconnect.php"; client.getHttpClient().getParams().setParameter(ClientPNames.ALLOW_CIRCULAR_REDIRECTS, true); client.get(url, null, new JsonHttpResponseHandler() { @Override public void onSuccess(JSONArray response) { Toast.makeText(getApplicationContext(), "Success", Toast.LENGTH_SHORT).show(); } @Override public void onFailure(Throwable e, JSONArray errorResponse) { Toast.makeText(getApplicationContext(), "Failure", Toast.LENGTH_SHORT).show(); } }); Thanks, Ashley

    Read the article

  • Handling multiple async HTTP requests in Silverlight serially

    - by Jeb
    Due to the async nature of http access via WebClient or HttpWebRequest in Silverlight 4, when I want to do multiple http get/posts serially, I find myself writing code that looks like this: doFirstGet(someParams, () => { doSecondGet(someParams, () => { doThirdGet(... } }); Or something similar. I'll end up nesting subsequent calls within callbacks usually implemented using lambdas of some sort. Even if I break things out into Actions or separate methods, it still ends up being hard to read. Does anyone have a clean solution to executing multiple http requests in SL 4 serially? I don't need things to be synchronous, I just want serial execution.

    Read the article

  • C# TCP Async EndReceive() throws InvalidOperationException ONLY on Windows XP 32-bit

    - by James Farmer
    I have a simple C# Async Client using a .NET socket that waits for timed messages from a local Java server used for automating commands. The messages come in asynchronously and is written to a ring buffer. This implementation seems to work fine on Windows Vista/7/8 and OSX, but will randomly throw this exception while it's receiving a message from the local Java server: Unhandled Exception: System.InvalidOperationException: EndReceive can only be called once for each asynchronous operation.     at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult, SocketError& errorCode)     at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)     at SocketTest.Controller.RecvAsyncCallback(IAsyncResult ar)     at System.Net.LazyAsyncResult.Complete(IntPtr userToken)     ... I've looked online for this error, but have found nothing really helpful. This is the code where it seems to break: /// <summary> /// Callback to receive socket data /// </summary> /// <param name="ar">AsyncResult to pass to End</param> private void RecvAsyncCallback(IAsyncResult ar) { // The exception will randomly happen on this call int bytes = _socket.EndReceive(_recvAsyncResult); // check for connection closed if (bytes == 0) { return; } _ringBuffer.Write(_buffer, 0, bytes); // Checks buffer CheckBuffer(); _recvAsyncResult = _sock.BeginReceive(_buffer, 0, _buffer.Length, SocketFlags.None, RecvAsyncCallback, null); } The error doesn't happen on any particular moment except in the middle of receiving a message. The message itself can be any length for this to happen, and the exception can happen right away, or sometimes even up to a minute of perfect communication. I'm pretty new with sockets and network communication, and I feel I might be missing something here. I've tested on at least 8 different computers, and the only similarity with the computers that throw this exception is that their OS is Windows XP 32-bit.

    Read the article

  • Using SoapExtensionAttributes on client side with async web methods

    - by Maxim Polishchuk
    Hey, I have a simple question. I implemented custom soap extension and registered it into client application configuration file. It works fine. (I would like to implement progress bar functionality like http://msdn.microsoft.com/en-us/library/aa480520.aspx) But I don't like some thing - custom soap extension is invoked by every call of my web service. In order to fix this situation (call WS just by required methods) I implemented custom SoapExtensionAttribute like below: [AttributeUsage(AttributeTargets.Method)] public class CustomSoapExtensionAttribute : SoapExtensionAttribute { public override int Priority { get; set; } public CustomSoapExtensionAttribute() : this (1) { } public CustomSoapExtensionAttribute(int priority) { Priority = priority; } public override Type ExtensionType { get { return typeof(CustomSoapExtension); } } } I added this attribute to required methods of web service proxy classes (and removed registration into client configuration file). My soap extension doesn't invoke when required web methods are calling. Can someone help me to solve this problem or select any other solution? Anotherone, I don't know it is important or not - my required methods are async web methods. Best regards, Maxim

    Read the article

  • problem in silverlight 4 async how to wait till result come

    - by AQEEL
    Here is what i have problem i have following code : //Get All master record entryE_QuestMaster = new ObservableCollection<E_QuestMaster>(); QuestVM.getExamsMasterbyExamID(eUtility.ConvertInt32(this.txtID.Text), ref entryE_QuestMaster); // //Loop to show questions int iNumber=1; foreach (var oIn in entryE_QuestMaster) { Node subNode = new Node(); subNode.Content = oIn.e_Question; subNode.Name = "Quest_" + iNumber.ToString().Trim(); subNode.Tag = oIn.e_QID.ToString(); subNode.Icon = "/Images/Number/" + iNumber.ToString().Trim() + ".gif"; iNumber++; this.tvMainNode.Nodes.Add(subNode); } here is async method calling wcf service /// <summary> /// /// </summary> /// <param name="ID"></param> public void getExamsMasterbyExamID(int ID, ref ObservableCollection<E_QuestMaster> iCollectionData) { ObservableCollection<E_QuestMaster> iCollectionDataResult = iCollectionData; eLearningDataServiceClient client = new eLearningDataServiceClient(); client.getExamsMasterCompleted+=(s,e)=> { iCollectionDataResult = e.Result; }; client.getExamsMasterAsync(ID); } problem : when ever system run -- QuestVM.getExamsMasterbyExamID(eUtility.ConvertInt32(this.txtID.Text), ref entryE_QuestMaster); its does not wait till i get e.result its just move to next line of code which is foreach loop. plssss help any one or give idea with sample code what should i do to wait till e.result i wanted to some how wait till i get e.result any idea ?

    Read the article

  • ScrollView content async downloading problem

    - by Newbee
    Hi! I have UIScrollView with lots of UIImageView inside. In the loadView method I assign some temporary image for each of subview UIImageView images and starts several threads to async download images from internet. Each thread downloads and assign images as follows: NSData *data = [NSData dataWithContentsOfURL:URL]; UIImage *img = [UIImage imageWithData:data]; img_view.image = img; Here is the problem - I expects picture will changed after each image downloaded by I can see only temporary images until all images will downloads. UIScrollView still interact while images downloads - I can scroll temporary images inside it and see scrollers and nothing blocks run loop, but downloaded images doesn't updates.. What I tried to do: Call sleep() in the download thread -- not helps. Call setNeedsDisplay for each ImageView inside ScrollView and for ScrollView -- not helps. What's wrong ? Thanks. Update. I tried some experiments with number of threads and number of images to download. Now I'm sure -- images redraws only when thread finished. For example - if I load 100 images with one thread -- picture updates one time after all images downloads. If I increase number of threads to 10 -- picture updates 10 times -- 10 images appears per update. One more update. I fixed problem by staring new thread from the downloading threads each time one image downloaded and exit current thread (instead of download several images in one thread in the cycle and exit thread only when all downloaded). Obviously it's not a good solution and there must be right approach.

    Read the article

  • Adding a ServiceReference programmatically during async postback

    - by Oliver
    Is it possible to add a new ServiceReference instance to the ScriptManager on the Page during an asynchronous postback so that subsequently I can use the referenced web service through client side script? I'm trying to do this inside a UserControl that sits inside a Repeater, that's why adding the ScriptReference programmatically during Page_Load does not work here. EDIT 2: This is the code I call from my UserControl which does not do what I expect (adding the ServiceReference to the ScriptManager during the async postback): private void RegisterWebservice(Type webserviceType) { var scm = ScriptManager.GetCurrent(Page); if (scm == null) throw new InvalidOperationException("ScriptManager needed on the Page!"); scm.Services.Add(new ServiceReference("~/" + webserviceType.Name + ".asmx")); } My goal is for my my UserControl to be as unobtrusive to the surrounding application as possible; otherwise I would have to statically define the ServiceReference in a ScriptManagerProxy on the containing Page, which is not what I want. EDIT: I must have been tired when I wrote this post... because I meant to write ServiceReference not ScriptReference. Updated the text above accordingly. Now I have: <asp:ScriptManagerProxy runat="server" ID="scmProxy"> <Services> <asp:ServiceReference Path="~/UsefulnessWebService.asmx" /> </Services> </asp:ScriptManagerProxy> but I want to register the webservice in the CodeBehind.

    Read the article

  • C# async callback on disposed form

    - by Rodney Burton
    Quick question: One of my forms in my winform app (c#) makes an async call to a WCF service to get some data. If the form happens to close before the callback happens, it crashes with an error about accessing a disposed object. What's the correct way to check/handle this situation? The error happens on the Invoke call to the method to update my form, but I can't drill down to the inner exception because it says the code has been optimized. The Code: public void RequestUserPhoto(int userID) { WCF.Service.BeginGetUserPhoto(userID, new AsyncCallback(GetUserPhotoCB), userID); } public void GetUserPhotoCB(IAsyncResult result) { var photo = WCF.Service.EndGetUserPhoto(result); int userID = (int)result.AsyncState; UpdateUserPhoto(userID, photo); } public delegate void UpdateUserPhotoDelegate(int userID, Binary photo); public void UpdateUserPhoto(int userID, Binary photo) { if (InvokeRequired) { var d = new UpdateUserPhotoDelegate(UpdateUserPhoto); Invoke(d, new object[] { userID, photo }); } else { if (photo != null) { var ms = new MemoryStream(photo.ToArray()); var bmp = new System.Drawing.Bitmap(ms); if (userID == theForm.AuthUserID) { pbMyPhoto.BackgroundImage = bmp; } else { pbPhoto.BackgroundImage = bmp; } } } }

    Read the article

  • problems with async jquery and loops

    - by Seth Vargo
    I am so confused. I am trying to append portals to a page by looping through an array and calling a method I wrote called addModule(). The method gets called the right number of times (checked via an alert statement), in the correct order, but only one or two of the portals actually populate. I have a feeling its something with the loop and async, but it's easier explained with the code: moduleList = [['weather','test'],['test']]; for(i in moduleList) { $('#content').append(''); for(j in moduleList[i]) { addModule(i,moduleList[i][j]); //column,name } } function addModule(column,name) { alert('adding module ' + name); $.get('/modules/' + name.replace(' ','-') + '.php',function(data){ $('#'+column).append(data); }); } for each array in the main array, I append a new column, since that's what each sub-array is - a column of portals. Then I loop through that sub array and call addModule on that column and the name of that module (which works correctly). Something buggy happens in my addModule method that it only adds the first and last modules, or sometimes a middle one, or sometimes none at all... im so confused!

    Read the article

  • Async WebRequest Timeout Windows Phone 7

    - by Tyler
    Hi All, I'm wondering what the "right" way of timing out an HttpWebRequest is on Windows Phone7? I've been reading about ThreadPool.RegisterWaitForSingleObject() but this can't be used as WaitHandles throw a Not implemented exception at run time. I've also been looking at ManualReset events but A) Don't understand them properly and B) Don't understand how blocking the calling thread is an acceptable way to implement a time out on an Async request. Here's my existing code sans timeout, can someone please show me how I would add a timeout to this? public static void Get(Uri requestUri, HttpResponseReceived httpResponseReceivedCallback, ICredentials credentials, object userState, bool getResponseAsString = true, bool getResponseAsBytes = false) { var httpWebRequest = (HttpWebRequest)WebRequest.Create(requestUri); httpWebRequest.Method = "GET"; httpWebRequest.Credentials = credentials; var httpClientRequestState = new JsonHttpClientRequestState(null, userState, httpResponseReceivedCallback, httpWebRequest, getResponseAsString, getResponseAsBytes); httpWebRequest.BeginGetResponse(ResponseReceived, httpClientRequestState); } private static void ResponseReceived(IAsyncResult asyncResult) { var httpClientRequestState = asyncResult.AsyncState as JsonHttpClientRequestState; Debug.Assert(httpClientRequestState != null, "httpClientRequestState cannot be null. Fatal error."); try { var webResponse = (HttpWebResponse)httpClientRequestState.HttpWebRequest.EndGetResponse(asyncResult); } }

    Read the article

  • Understanding Async Concept in WebServices

    - by 8EM
    I've had the thrill recently of developing web service applications. Most of my experience is with GWT and mainly doing most things on the client side then doing an async call back for any additional data needed. However at the moment, I want a process that will be triggered on the client side, then on the server side, a loop will occur, where if a certain condition is met, it will 'push' back to the client. This will hopefully remove the processor usage on the client side and also saves bandwidth. What is this called? I understand 'polling' is where the client side continuously hits a server, however what I want is the opposite. Is this possible? Am I misunderstanding what happened when I trigger an AsyncService in GWT? Please advise. EDIT: Just for further clarification: Having some kind of weather data service. Where, you trigger 'go' on the client side, then on the server side, it checks to see the degrees, if it has moved since last time, it will spit back the degrees to the client, if it hasn't, it will keep looping.

    Read the article

  • Chrome extension sendRequest from async callback not working?

    - by Eugene
    Can't figure out what's wrong. onRequest not triggered on call from async callback method, the same request from content script works. The sample code below. background.js ============= ... makeAsyncRequest(); ... chrome.extension.onRequest.addListener(function(request, sender, sendResponse) { switch (request.id) { case "from_content_script": // This works console.log("from_content_script"); sendResponse({}); // clean up break; case "from_async": // Not working! console.log("from_async"); sendResponse({}); // clean up break; } }); methods.js ========== makeAsyncRequest = function() { ... var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function() { if (xhr.readyState == 4) { ... // It works console.log("makeAsyncRequest callback"); chrome.extension.sendRequest({id: "from_async"}, function(response) { }); } } ... }; UPDATE: manifest configuration file. Don't no what's wrong here. { "name": "TestExt", "version": "0.0.1", "icons": { "48": "img/icon-48-green.gif" }, "description": "write it later", "background_page": "background.html", "options_page": "options.html", "browser_action": { "default_title": "TestExt", "default_icon": "img/icon-48-green.gif" }, "permissions": [ "tabs", "http://*/*", "https://*/*", "file://*/*", "webNavigation" ] }

    Read the article

  • 'WebException' error on back button even when calling 'void' async method

    - by BlazingFrog
    I have a windows phone app that allows the user to interact with it. Each interaction will always result in an async WCF call. In addition to that, some interactions will result in opening the browser, maps, email, etc... The problem is that, when hitting the back button, I sometime get the following error "An error (WebException) occurred while transmitting data over the HTTP channel." with the following stack trace: at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason) at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result) at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.OnGetResponse(IAsyncResult result) at System.Net.Browser.ClientHttpWebRequest.<>c__DisplayClassa.<InvokeGetResponseCallback>b__8(Object state2) at System.Threading.ThreadPool.WorkItem.WaitCallback_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadPool.WorkItem.doWork(Object o) at System.Threading.Timer.ring() My understanding is that it's happening because my app opened another app (browser, maps, etc) before it had the time to execute the EndMyAsyncMethod(System.IAsyncResult result). Fair enough... What's really annoying is that it seems it should get fixed by cloning the server-side method, only making it void with the following operation contract [OperationContract(IsOneWay = true)] but I'm still getting the error. What's worse is that the exception is thrown in a system-generated part of the code and, thus, cannot be manually caught causing the app to just crash. I simply don't understand the need to execute an Endxxx method when it's explicitely marked as OneWay and void. EDIT I did find a similar issue here. It does seem that it is related to the message getting to the service (not the client callback). My next question is: if I'm now calling a method marked AsyncPattern and OneWay, what exactly should I be waiting for on the client to be sure the message was transmitted successfully? This is new service definition: [OperationContract(IsOneWay = true, AsyncPattern = true)] IAsyncResult BeginCacheQueryWithoutCallback(string param1, QueryInfoDataContract queryInfo, AsyncCallback cb, Object s); void EndCacheQueryWithoutCallback(IAsyncResult r); And the implementation: public IAsyncResult BeginCacheQueryWithoutCallback(string param1, QueryInfoDataContract queryInfo, AsyncCallback cb, Object s) { // do some stuff return new CompletedAsyncResult<string>(""); } public void EndCacheQueryWithoutCallback(IAsyncResult r) { }

    Read the article

  • Jquery .ajax async postback on C# UserControl

    - by tnriverfish
    I'm working on adding a todo list to a project system and would like to have the todo creation trigger a async postback to update the database. I'd really like to host this in a usercontrol so I can drop the todo list onto a project page, task page or stand alone todo list page. Here's what I have. User Control "TodoList.ascx" which lives in the Controls directory. The script that sits at the top of the UserControl. You can see where I started building jsonText to postback but when that didn't work I just tried posting back an empty data variable and removed the 'string[] items' variable from the AddTodo2 method. <script type="text/javascript"> $(document).ready(function() { // Add the page method call as an onclick handler for the div. $("#divAddButton").click(function() { var jsonText = JSON.stringify({ tdlId: 1, description: "test test test" }); //data: jsonText, $.ajax({ type: "POST", url: "TodoList.aspx/AddTodo2", data: "{}", contentType: "application/json; charset=utf-8", dataType: "json", success: function(msg) { alert('retrieved'); $("#divAddButton").text(msg.d); }, error: function() { alert("error"); } }); }); });</script> The rest of the code on the ascx. <div class="divTodoList"> <asp:PlaceHolder ID="phTodoListCreate" runat="server"> <div class="divTLDetail"> <div>Description</div> <div><asp:TextBox ID="txtDescription" runat="server"></asp:TextBox></div> <div>Active</div> <div><asp:CheckBox ID="cbActive" runat="server" /></div> <div>Access Level</div> <div><asp:DropDownList ID="ddlAccessLevel" runat="server"></asp:DropDownList></div> </div> </asp:PlaceHolder> <asp:PlaceHolder ID="phTodoListDisplayHeader" runat="server"> <div id="divTLHeader"> <asp:HyperLink ID="hlHeader" runat="server"></asp:HyperLink> </div> </asp:PlaceHolder> <asp:PlaceHolder ID="phTodoListItems" runat="server"> <div class="divTLItems> <asp:Literal ID="litItems" runat="server"></asp:Literal> </div> </asp:PlaceHolder> <asp:PlaceHolder ID="phAddTodo" runat="server"> <div class="divTLAddItem"> <div id="divAddButton">Add Todo</div> <div id="divAddText"><asp:TextBox ID="txtNewTodo" runat="server"></asp:TextBox></div> </div> </asp:PlaceHolder> <asp:Label ID="lbTodoListId" runat="server" style="display:none;"></asp:Label></div> To test the idea I created a /TodoList.aspx page that lives in the root directory. <uc1:TodoList runat="server" ID="tdl1" TodoListId="1" ></uc1:TodoList> The cs for the todolist.aspx protected void Page_Load(object sender, EventArgs e) { SecurityManager sm = new SecurityManager(); sm.MemberLevelAccessCheck(MemberLevelKey.AreaAdmin); } public static string AddTodo2() { return "yea!"; } My hope is that I can have a control that can be used to display multiple todo lists and create a brand new todo list as well. When I click on the #divAddButton I can watch it build the postback in firebug but once it completes it runs the error portion by alerting 'error'. I can't see why. I'd really rather have the response method live inside the user control as well. Since I'll be dropping it on several pages to keep from having to go put a method on each individual page. Any help would be appreciated.

    Read the article

  • Boost Asio UDP retrieve last packet in socket buffer

    - by Alberto Toglia
    I have been messing around Boost Asio for some days now but I got stuck with this weird behavior. Please let me explain. Computer A is sending continuos udp packets every 500 ms to computer B, computer B desires to read A's packets with it own velocity but only wants A's last packet, obviously the most updated one. It has come to my attention that when I do a: mSocket.receive_from(boost::asio::buffer(mBuffer), mEndPoint); I can get OLD packets that were not processed (almost everytime). Does this make any sense? A friend of mine told me that sockets maintain a buffer of packets and therefore If I read with a lower frequency than the sender this could happen. ¡? So, the first question is how is it possible to receive the last packet and discard the ones I missed? Later I tried using the async example of the Boost documentation but found it did not do what I wanted. http://www.boost.org/doc/libs/1_36_0/doc/html/boost_asio/tutorial/tutdaytime6.html From what I could tell the async_receive_from should call the method "handle_receive" when a packet arrives, and that works for the first packet after the service was "run". If I wanted to keep listening the port I should call the async_receive_from again in the handle code. right? BUT what I found is that I start an infinite loop, it doesn't wait till the next packet, it just enters "handle_receive" again and again. I'm not doing a server application, a lot of things are going on (its a game), so my second question is, do I have to use threads to use the async receive method properly, is there some example with threads and async receive? Thanks for you attention.

    Read the article

  • Android ASync task ProgressDialog isn't showing until background thread finishes

    - by jackbot
    I've got an Android activity which grabs an RSS feed from a URL, and uses the SAX parser to stick each item from the XML into an array. This all works fine but, as expected, takes a bit of time, so I want to use AsyncActivity to do it in the background. My code is as follows: class AddTask extends AsyncTask<Void, Item, Void> { protected void onPreExecute() { pDialog = ProgressDialog.show(MyActivity.this,"Please wait...", "Retrieving data ...", true); } protected Void doInBackground(Void... unused) { items = parser.getItems(); for (Item it : items) { publishProgress(it); } return(null); } protected void onProgressUpdate(Item... item) { adapter.add(item[0]); } protected void onPostExecute(Void unused) { pDialog.dismiss(); } } Which I call in onCreate() with new AddTask().execute(); The line items = parser.getItems() works fine - items being the arraylist containing each item from the XML. The problem I'm facing is that on starting the activity, the ProgressDialog which i create in onPreExecute() isn't displayed until after the doInBackground() method has finished. i.e. I get a black screen, a long pause, then a completely populated list with the items in. Why is this happening? Why isn't the UI drawing, the ProgressDialog showing, the parser getting the items and incrementally adding them to the list, then the ProgressDialog dismissing?

    Read the article

  • C# iterator for async file copy

    - by uno
    Been running in circles to find the best solution for my client. We have a server that images are uploaded via ftp. I want to write an application that scans this server at frequent intervals and if it finds files it copies them to another,processing server. So if during a time cycle, my app finds that there are 100 files, i want to start copying as many files as i can across to the processing server i figured delegates would be the way to go but now i come across iterators...what do the experts say?

    Read the article

  • Silverlight Async Timeout Error

    - by Nath
    Calling through to my Silverlight Enabled WCF-Service in my silverlight application, occasionally users get timeouts. Whats the easiest way to boost the time allowed by the service client for a response? The exact exception thrown is: System.TimeoutException: [HttpRequestTimedOutWithoutDetail] Thanks

    Read the article

  • WCF <operation>Async methods not generated in proxy interface

    - by Charlie
    I want to use the Asnyc methods rather than the Begin on my WCF service client proxy because I'm updating WPF controls and need to make sure they're being updated from the UI thread. I could use the Dispatcher class to queue items for the UI thread but that's not what I'm asking about.. I've configured the service reference to generate the asynchronous operations, but it only generates the methods in proxy's implementation, not it's interface. The interface only contains syncronous and Begin methods. Why aren't these methods generated in the interface and is there a way to do this, or do I have to create a derived interface to manually add them?

    Read the article

  • ASP.NET MVC async call a WCF service.

    - by mmcteam
    Hi all. After complete of asynchronous call to WCF service I want set success message into session and show user the notification . I tried use two ways for complete this operation. 1) Event Based Model. client.GetDataCompleted += new EventHandler<GetDataCompletedEventArgs>(GetDataCompleted); client.GetDataAsync(id, client); private void GetDataCompleted(object obj, GetDataCompletedEventArgs e) { this.SetNotification(new Notification() { Message = e.Result, Type = NotificationType.Success }); } In MyOperationCompleted event i can set notification to HttpContext.Current.Session, but I must waiting before this operation will completed and can't navigate to others pages. 2) IAsyncResult Model. client.BeginGetData(id, GetDataCallback, client); private void GetDataCallback(IAsyncResult ar) { string name = ((ServiceReference1.Service1Client)ar.AsyncState).EndGetData(ar); this.SetNotification(new Notification() { Message = name, Type = NotificationType.Success }); } "Generate asynchronous operations" in service reference enabled. Please help me with this trouble. I novice in ASP.NET MVC. Thanks.

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >