Search Results

Search found 1226 results on 50 pages for 'asynchronous'.

Page 9/50 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Is NSXMLParser's parse method asynchronous

    - by Ben Guest
    Is NSXMLParser's parse method asynchronous? in other words if i have an NSXMLParse object and i call [someParseObject parse] from the main thread, will it block the main thread while it does it's thing? -Thanks for answering this seemingly noob question. -Ben

    Read the article

  • ASP.NET MVC redirect from asynchronous call

    - by Idsa
    I send asynchronous call using jQuery form plugin and in the case of success want to redirect user to some "success-page". Now my ASP.NET MVC action just returns some special "success-JSON" and the user is redirected using Javascript. Is there any way to implement automatic redirect (without Javascript call)?

    Read the article

  • Synchronous and asynchronous callbacks

    - by csharpbaby
    I get confused with some terms while reading MSDN documents and code samples. What are callbacks in C#? In particular, what are synchronous and asynchronous callbacks ? Please explain these from a layman's point of view. Also, please explain the IAsyncResult interface. How can we implement it? (with very simple example) Thanks in advance. EDITED: Fixed spelling, grammar

    Read the article

  • Fast or asynchronous AS3 JPEG encoding

    - by Bart van Heukelom
    I'm currently using the JPGEncoder from the AS3 core lib to encode a bitmap to JPEG var enc:JPGEncoder = new JPGEncoder(90); var jpg:ByteArray = enc.encode(bitmap); Because the bitmap is rather large (3000 x 2000) the encoding takes a long while (about 20 seconds), causing the application to seemingly freeze while encoding. To solve this, I need either: An asynchronous encoder so I can keep updating the screen (with a progress bar or something) while encoding An alternative encoder which is simply faster Is either possible?

    Read the article

  • C-library consists of asynchronous DNS resolver

    - by egiakoum1984
    Need to find a asynchronous DNS resolver implemented in C (except Sofia Resolver) which supports DNS queries for NAPTR, SRV and A records. It would be desired to support internal caching. Any suggestions/recommendations? Currently looking at ldns which supports NAPTR, SVC and A queries. But, If I have understood correctly, it is not asynch DNS resolver.

    Read the article

  • java asynchronous task.

    - by Tony
    For some of HTTP requests from clients, there was very complex business logic in server side. Some of these business logics doesn't require to response to the client immediately, like sending a email to somebody. Can I put those tasks in an asynchronous method.

    Read the article

  • CFHost DNS Resolution - When is it OK to use synchronous API?

    - by Jasarien
    I went to the iPhone Developer Tech Talk a few months ago and asked one of the gurus there about the lack of NSHost on the iPhone. Some code I was porting to the iPhone made significant use of NSHost throughout its networking code. I was told that NSHost is on the iPhone, but its private. I was also told that NSHost is a synchronous API and that I shouldn't use it anyway. (If anyone could elaborate on why it shouldn't be used, as a bonus, that'd be great.) I can see the caveats of using synchronous API's on the main thread in that they'll block until complete - and that's never a good thing with network code because there are so many factors that could cause the API to block the thread for a significant amount of time. My solution was to write a wrapper around CFHost's asynchronous resolution functions. The result works quite well, and I'm considering releasing it into the public domain. But my question is this: Say my app only resolves a hostname once per run, during the connecting phase, and then cache's it for the rest of the session. During the time it is resolving, a modal screen is shown telling the user "Connecting" with a nice spinner. Does it really matter whether or not the resolution is asynchronous?? The user has to wait to connect anyway, and the resolution is only done on the first connection. Subsequent connections use the cached result of the resolution. When is it OK to be synchronous and when should things be asynchronous?

    Read the article

  • Differences in ansychronous VB.NET and C#???

    - by Jim Beam
    So I've been posting this week for help with an API that has asynchronous calls. You can view the CODE here: http://stackoverflow.com/questions/2638920/c-asynchronous-event-procedure-does-not-fire With a little more digging, I found out that the API is written in VB.NET and I created a VB.NET example and guess what . . . the asynchronous calls work like a charm. So, now I need to find out why the calls are not firing in the C# code I have. The API being written in VB really shouldn't matter, but again, the VB.NET code works and my C# does not. Is there a problem with the event handler and hows its being declared that causes it to not fire? UPDATE VB Code added Imports ClientSocketServices Imports DHS_Commands Imports DHS Imports Utility Imports SocketServices Class Window1 Public WithEvents AppServer As New ClientAppServer Public Token As LoginToken Private Sub login() Dim handler As New LoginHandler Token = handler.RequestLogin("admin", "admin", localPort:=12000, serverAddress:="127.0.0.1", serverLoginPort:=11000, clienttype:=LoginToken.eClientType.Client_Admin, timeoutInSeconds:=20) If Token.Authenticated Then AppServer = New ClientAppServer(Token, True) AppServer.RetrieveCollection(GetType(Gateways)) End If End Sub Private Sub ReceiveMessage(ByVal rr As RemoteRequest) Handles AppServer.ReceiveRequest If TypeOf (rr.TransferObject) Is Gateways Then MsgBox("dd") End If End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles Button1.Click login() End Sub End Class

    Read the article

  • Making an asynchronous Client with boost::asio

    - by tag
    Hello, i'm trying to make an asynchronous Client with boost::asio, i use the daytime asynchronous Server(in the tutorial). However sometimes the Client don't receive the Message, sometimes it do :O I'm sorry if this is too much Code, but i don't know what's wrong :/ Client: #include <iostream> #include <stdio.h> #include <ostream> #include <boost/thread.hpp> #include <boost/bind.hpp> #include <boost/array.hpp> #include <boost/asio.hpp> using namespace std; using boost::asio::ip::tcp; class TCPClient { public: TCPClient(boost::asio::io_service& IO_Service, tcp::resolver::iterator EndPointIter); void Write(); void Close(); private: boost::asio::io_service& m_IOService; tcp::socket m_Socket; boost::array<char, 128> m_Buffer; size_t m_BufLen; private: void OnConnect(const boost::system::error_code& ErrorCode, tcp::resolver::iterator EndPointIter); void OnReceive(const boost::system::error_code& ErrorCode); void DoClose(); }; TCPClient::TCPClient(boost::asio::io_service& IO_Service, tcp::resolver::iterator EndPointIter) : m_IOService(IO_Service), m_Socket(IO_Service) { tcp::endpoint EndPoint = *EndPointIter; m_Socket.async_connect(EndPoint, boost::bind(&TCPClient::OnConnect, this, boost::asio::placeholders::error, ++EndPointIter)); } void TCPClient::Close() { m_IOService.post( boost::bind(&TCPClient::DoClose, this)); } void TCPClient::OnConnect(const boost::system::error_code& ErrorCode, tcp::resolver::iterator EndPointIter) { if (ErrorCode == 0) // Successful connected { m_Socket.async_receive(boost::asio::buffer(m_Buffer.data(), m_BufLen), boost::bind(&TCPClient::OnReceive, this, boost::asio::placeholders::error)); } else if (EndPointIter != tcp::resolver::iterator()) { m_Socket.close(); tcp::endpoint EndPoint = *EndPointIter; m_Socket.async_connect(EndPoint, boost::bind(&TCPClient::OnConnect, this, boost::asio::placeholders::error, ++EndPointIter)); } } void TCPClient::OnReceive(const boost::system::error_code& ErrorCode) { if (ErrorCode == 0) { std::cout << m_Buffer.data() << std::endl; m_Socket.async_receive(boost::asio::buffer(m_Buffer.data(), m_BufLen), boost::bind(&TCPClient::OnReceive, this, boost::asio::placeholders::error)); } else { DoClose(); } } void TCPClient::DoClose() { m_Socket.close(); } int main() { try { boost::asio::io_service IO_Service; tcp::resolver Resolver(IO_Service); tcp::resolver::query Query("127.0.0.1", "daytime"); tcp::resolver::iterator EndPointIterator = Resolver.resolve(Query); TCPClient Client(IO_Service, EndPointIterator); boost::thread ClientThread( boost::bind(&boost::asio::io_service::run, &IO_Service)); std::cout << "Client started." << std::endl; std::string Input; while (Input != "exit") { std::cin >> Input; } Client.Close(); ClientThread.join(); } catch (std::exception& e) { std::cerr << e.what() << std::endl; } } Server: http://www.boost.org/doc/libs/1_39_0/doc/html/boost_asio/tutorial/tutdaytime3/src.html Regards :)

    Read the article

  • asynchronous javascript loading/executing

    - by Kai
    In this post, asynchronous .js file loading syntax, someone said, "If the async attribute is present, then the script will be executed asynchronously, as soon as it is available." (function() { var d=document, h=d.getElementsByTagName('head')[0], s=d.createElement('script'); s.type='text/javascript'; s.async=true; s.src='/js/myfile.js'; h.appendChild(s); }()); /* note ending parenthesis and curly brace */ My question is, what does "the script will be executed asynchronously" mean? Will this script be executed in a different thread from other javascripts in the page? If yes, should we worry about synchronization issue in the two threads? Thanks.

    Read the article

  • Asynchronous Processing = Spanning Threads = Valid?

    - by jens
    Hello Experts, am I allowed (without any sideeffects) to create and start a new Thread() from within a doGet() Method of a servlet? Or does this somehow leak ressources? Is it valid to also pass the "Session" Object into the Thread to later save the result of my asynchronous processing (I will synchronized correctly) in the session? Or will this leak ressources when using the session "in indepedant threads"? = What would happen if the session meanwhile would be expired by the webcontainer as it has timedout and I will access it from my thread? Or would could this also lead to the sideffect, that storing the session in the thread will prevent the webcontainer from expiring the session at all (and therefore finally leak ressources as the sessions do not get cleared up)? (I know there are other Solutions, like working with DB-(Job)Records, JMS or Servlets 3.0) but I need so solve the problem as described by spanning a new Thread within doGet.) Thank you very much!! Jens

    Read the article

  • how to get the http header in asynchronous request mode using ASIHHTTP

    - by user262325
    Hello everyone I hope to display the download file size by reading http header. I know there is way do this: ASIHTTPRequest request = [ASIHTTPRequest requestWithURL:url]; [request startSynchronous]; NSString poweredBy = [[request responseHeaders] objectForKey:@"X-Powered-By"]; NSString *contentType = [[request responseHeaders] objectForKey:@"Content-Type"]; but this is Synchronous mode, in Asynchronous mode it can be done as below: (void)requestFinished:(ASIHTTPRequest *)request { unsigned long long contentLength = [request contentLength]; } but 'requestFinished' is at the end of download. Is there an event to get the http header info at the beginning of download? Thank interdev

    Read the article

  • Multiple port asynchronous I/O over serialport in C#

    - by firoso
    I'm trying to write a test application for serial I/O (RS-232) with multiple units in C# and I'm running into an issue with my lack of threading experience so I'm soliciting feedback for a best known method. I've got a pool of COM ports COM1-16 each of which can read/write at any time and I need to be able to manage them simultaneously. Is this a situation for a thread pool? What is some guidance on structuring this applet? Edit: Upon review I was wondering is I really even need to do asynchronous threads here, I could just maintain states for each COM-port and do flow logic (i.e., statemachine) for each COM-port individually.

    Read the article

  • Asynchronous Request make for-Loop waiting for didFinishLoading

    - by rdesign
    Hey guys, I have a asynchronous url request within a for loop. This loop is called 20 times, each time one parameter of the webaddress is changed. Everytime the didFinishLoading method is called I want to hand over the data of this specific webadress. The problem now is that when I run the for loop, the didFinishLoading method is not called, only at the end. Any suggenstions on how to make the loop wait for complete loading the data for the specific URL? Thanks a lot.

    Read the article

  • EHsc vc EHa (synchronous vs asynchronous exception handling)

    - by watson1180
    Could you give a bullet list of practical differences/implication? I read relevant MSDN article, but my understanding asynchronous exceptions is still a bit hazy. I am writing a test suite using Boost.Test and my compiler emits a warning that EHa should be enabled: warning C4535: calling _set_se_translator() requires /EHa The project itself uses only plain exceptions (from STL) and doesn't need /EHa switch. Do I have to recompile it with /EHa switch to make the test suite work properly? My feeling is that I need /EHa for the test suit only. Thank you and happy new year.

    Read the article

  • Reload external javascript after asynchronous postback via UpdatePanel

    - by Protector one
    I have an external javascript on my page, e.g. something like: <script src="http://foo.com/script.js" type="text/javascript"></script> and an UpdatePanel somewhere. The script writes some content, and does this from within an anonymous javascript function in the js file. I.e., there is something like this in the script: (function(){document.write('content');})(); Whenever the UpdatePanel is updated through asynchronous postback, everything the script did (or any javascript on my page, for that matter) is made undone. For normal javascript, I would just use: Sys.WebForms.PageRequestManager.getInstance().add_endRequest(myFunction) to redo all that, but since the function in the script source file is anonymous and called upon definition, I'm SOL! Any ideas? Note: the external js source is from another domain and its content is out of my control.

    Read the article

  • read http header info in ASIHttpRequest asynchronous

    - by user262325
    Hello everyone One of my project is to download several large size files using ASIHTTPRequest in asynchronous mode. I hope to read the http returned header info to get the size of files. I know [request respsonseHeaders] (requestFinished: delegate method ) can do that. I tested and found that requestFinished: is only triggered when it completed the download of a whole single file. But I hope to access the function [request respsonseHeaders] before ASIHTTPRequest starting to download files (just when ASIHTTPRequest got the returned header info). I can not find the triggered event for this. Welcome any comment Thanks interdev

    Read the article

  • Is Graphics.DrawImage asynchronous?

    - by Roy
    Hi all, I was just wondering, is Graphics.DrawImage() asynchronous? I'm struggling with a thread safety issue and can't figure out where the problem is. if i use the following code in the GUI thread: protected override void OnPaint(PaintEventArgs e) { lock (_bitmapSyncRoot) { e.Graphics.DrawImage(_bitmap, _xPos, _yPos); } } And have the following code in a separate thread: private void RedrawBitmapThread() { Bitmap newBitmap = new Bitmap(_width, _height); // Draw bitmap // Bitmap oldBitmap = null; lock (_bitmapSyncRoot) { oldBitmap = _bitmap; _bitmap = newBitmap; } if (oldBitmap != null) { oldBitmap.Dispose(); } Invoke(Invalidate); } Could that explain an accessviolation exception? The code is running on a windows mobile 6.1 device with compact framework 3.5.

    Read the article

  • question about asynchronous http

    - by rantravee
    Hi , I just want to check if I understood well the way asynchronous Http request work on Android. Suppose I make such a request and set a ResponseHandler<String> responseHandler to handle the response. By doing this is it possible to have the UI thread blocked waiting for the response ? The implication being that the code in the function: public String handleResponse(HttpResponse response) is also executed on the UI thread or is there silently spawned a thread that waits for the response and calls the handleResponse(HttpResponse response) function when the response arrives ?

    Read the article

  • Live asynchronous time feed for websites

    - by Maven
    I want to show up the time over my website based over the location of the user, let’s say if user one browsing the website is from USA than the time should be what is in USA currently and same for China etc. and all. I was wondering if there exists a JavaScript plugin for it but I didn’t find any as dynamic as I want, my requirements include: Something that can be fully stylized according to website theme (no iframes) The pattern I want is to be in (HH:MM:SS) It should be asynchronous like the second [SS] keep ticking and the time keep updating Is this possible, a way around to achieve it?

    Read the article

  • Clean way in GWT/Java to wait for multiple asynchronous events to finish

    - by gerdemb
    What is the best way to wait for multiple asynchronous callback functions to finish in Java before continuing. Specifically I'm using GWT with AsyncCallback, but I think this is a generic problem. Here's what I have now, but surely there is cleaner way... AjaxLoader.loadApi("books", "0", new Runnable(){ public void run() { bookAPIAvailable = true; ready(); }}, null); AjaxLoader.loadApi("search", "1", new Runnable(){ public void run() { searchAPIAvailable = true; ready(); }}, null); loginService.login(GWT.getHostPageBaseURL(), new AsyncCallback<LoginInfo>() { public void onSuccess(LoginInfo result) { appLoaded = true; ready(); } }); private void ready() { if(bookAPIAvailable && searchAPIAvailable && appLoaded) { // Everything loaded } }

    Read the article

  • VC++ - Asynchronous Thread

    - by JVNR
    I am working on VC++ project, in that my application process a file from input path and generates 3 output "*.DAT" files in the destination path. I will FTP these DAT file to the destination server. After FTP, I need to delete only two output .DAT files the folder. I am able to delete those files, because there one Asynchronous thread running behind the process. Since the thread is running, while deleting it says, "Cannot delete, the file is used by another person". I need to stop that thread and delete the files. Multiple files can also be taken from the input path to process. Please help me in resolving this issue. Its very high priority issue for me. Please help me ASAP.

    Read the article

  • A strange bug, is Mysql asynchronous?

    - by Farf
    Hello, I have a strange bug. I launch a PHP Unit test Suite. At the beginning, it executes a big query to initialize the database. If I put a breakpoint just after the execution of the sql, there is no problem and my tests pass. If I don't put any break point, they don't pass and say that the tables don't exist! It works as if the sql query was asynchronous! Do you have an idea of the bug? Or how to debug that? Thanks a lot in advance for your help, I'm lost! Farf

    Read the article

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