Search Results

Search found 6694 results on 268 pages for 'wait states'.

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

  • recvfrom() return values in Stop-and-Wait UDP?

    - by mavErick
    I am trying to implement a Stop-and-Wait UDP client-server socket program in C. As known, there are basically three possible scenarios for Stop-and-Wait flow control. i.e., After transmitting a packet, the sender receives a correct ACK and thus starts transmitting the next packet; the sender receives an incorrect ACK and thus retransmits this packet; the sender receives no ACK within a TIMEOUT and thus retransmits this packet. My idea is to differentiate these three scenarios with the return value of recvfrom() on the sender side. For scenario 1&2: recvfrom() just returns the length of the received ACK. Since in my implementation the incorrect ACK is of the same length of the correct one, so I will have to go deeper and check the contents of the ACK. It's not a big deal. I know how to do. Problems come when I am trying to recognize scenario 3 where no ACK is received. What confuses me is that my recvfrom() is within a while loop, so the recvfrom() will be called constantly. What will it return when the receiver is not actually sending the sender ACK? Is it 0 or 1?

    Read the article

  • Any store/website selling Ubuntu-branded merchandise within United States?

    - by MIH1406
    I checked two websites about Ubuntu-branded merchandise but they charge too much for the products and for the shipping. I think because they are not within United States and the shipping is classified as International shipping. Any idea about stores or websites that are local to United States? I tried amazon but I could not find the same items. These what I had already checked: http://shop.canonical.com/ http://www.unixstickers.com/

    Read the article

  • ModalPopup CodeBehind Function Wait For User Response

    - by Snave
    I have set up a function which returns an enum of the button that the user clicked in the ModalPopup. I have a variable of type enum to store which button the user clicks in the button click event. In this function, I call the ModalPopupExtender's Show() method. My problem is, the function finishes out and returns the default enum (which is "none" since no button was clicked yet) before the ModalPopup can be shown and store which button the user clicks. So without changing the function to a method and using a different way to store the user's button click, how can I pause the function after the Show() method of the MPE has been called and wait for the user to click a button? Edit(11/20/2009): Clarification: On the aspx page, I include a ScriptManager, PlaceHolder, and an asp:Button with a codebehind click event. What I want is to click the button, then in the click event handler, I want to call a custom static class function that returns a variable. One of the arguments it takes is the PlaceHolder. The function creates all the necessary controls in the PlaceHolder needed to display a ModalPopup. It calls the created ModalPopupExtender's Show() method. What should happen: At this point is the ModalPopup gets displayed, the user clicks a button, that button's event handler fires, the button sets a variable indicating that it was clicked, it then calls the ModalPopupExtender's .Hide() method, and then the function returns the variable that indicates which button was clicked. We then return to the event handler from the original button that was clicked and the programmer can then perform some logic based on what variable was returned. Crux: When the ModalPopupExtender's .Show() method gets called, it does not display the ModalPopup until AFTER the function returns a default variable (because no button was clicked yet) and after the event handler from the original button that was clicked ends. What I need: After the ModalPopupExtender's .Show() method is called, I need the ModalPopup to get displayed immediately and I need the function to wait for a button click to be made from the ModalPopup. My thoughts: Some PostBack needs to be made to the page telling it to update and display the ModalPopup Panel. Then maybe a while loop can be run in the function that waits for a button to be clicked in the ModalPopup.

    Read the article

  • Run bat file in Java and wait 2

    - by Savvas Dalkitsis
    This is a followup question to my other question : http://stackoverflow.com/questions/2434125/run-bat-file-in-java-and-wait The reason i am posting this as a separate question is that the one i already asked was answered correctly. From some research i did my problem is unique to my case so i decided to create a new question. Please go read that question before continuing with this one as they are closely related. Running the proposed code blocks the program at the waitFor invocation. After some research i found that the waitFor method blocks if your process has output that needs to be proccessed so you should first empty the output stream and the error stream. I did those things but my method still blocks. I then found a suggestion to simply loop while waiting the exitValue method to return the exit value of the process and handle the exception thrown if it is not, pausing for a brief moment as well so as not to consume all the CPU. I did this: import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Test { public static void main(String[] args) { try { Process p = Runtime.getRuntime().exec( "cmd /k start SQLScriptsToRun.bat" + " -UuserName -Ppassword" + " projectName"); final BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream())); final BufferedReader error = new BufferedReader(new InputStreamReader(p.getErrorStream())); new Thread(new Runnable() { @Override public void run() { try { while (input.readLine()!=null) {} } catch (IOException e) { e.printStackTrace(); } } }).start(); new Thread(new Runnable() { @Override public void run() { try { while (error.readLine()!=null) {} } catch (IOException e) { e.printStackTrace(); } } }).start(); int i = 0; boolean finished = false; while (!finished) { try { i = p.exitValue(); finished = true; } catch (IllegalThreadStateException e) { e.printStackTrace(); try { Thread.sleep(500); } catch (InterruptedException e1) { e1.printStackTrace(); } } } System.out.println(i); } catch (IOException e) { e.printStackTrace(); } } } but my process will not end! I keep getting this error: java.lang.IllegalThreadStateException: process has not exited Any ideas as to why my process will not exit? Or do you have any libraries to suggest that handle executing batch files properly and wait until the execution is finished?

    Read the article

  • Buildr, Gradle or wait for Maven 3?

    - by Sten Roger
    I am really tired of struggling with Maven 2 all the time. Build tools should not be in the way. Recently I have been looking at Buildr and Gradle. Maven 3 seems to fix some of the struggles. So, what should I go for now? Buildr? Gradle? Or wait a year for Maven 3?

    Read the article

  • Insert wait in VS2008 web test.

    - by SonOfOmer
    Hi everyone, How can I insert time wait value in web test in Visual Studio 2008 test edition? I have recorded a web test that I want to use in Load test. Now I need to put some time delay between pages in web test. Thanks a lot.

    Read the article

  • wait after presentModalViewController

    - by Cesar
    I need to wait (don't execute the code) after the presentModalViewController until the modal view it's dismissed, it's possible or it's a conceptual error ? -(NSDictionary *)authRequired { [self presentModalViewController:loginRegView animated:YES]; //This view write the settings when dismissed. NSMutableDictionary *ret=[[NSMutableDictionary alloc] init]; [ret setObject:[app.settings get:@"user"] forKey:@"user"]; [ret setObject:[app.settings get:@"pass"] forKey:@"pass"]; return ret; }

    Read the article

  • Javascript Wait and pause

    - by Ajith
    I need to execute a function in javascript named demo() and sample() optionally.ie,first my program will wait for 5 seconds to execute demo(); if it is fail to start demo with in 5 seconds i need to execute sample() automatically (from javascript).is it possible to do in javascript?Please help me....Thanks

    Read the article

  • Wait function in Java

    - by user220755
    So I am writing a Java code to represent a heap sort and to represent the operation I need to have a waiting function which will wait between different operation but I am not sure if there is a function in Java that does that or do I need to write the function by myself and how would i do that. Representing heap sport is a homework but writing the waiting function isn't so I appreciate your help

    Read the article

  • how to put a thread in Wait in Android

    - by Brijesh Masrani
    I have a thread running in my program When Mouse-down Event generates I want to put that thread in wait() and in Mouse-up I want to Notify that thread But when I tried to do this It is giving me error like "Object not locked by Thread" so can anyone help me how to solve this..

    Read the article

  • Wait during iPhone UI modification

    - by paul simmons
    Hi, I am making modifications to elements on UI. There is no (extra) thread or any async. calls. However I want to give a slow motion effect, so wait specific time at each step in a for loop. How can I achieve this without blocking the UI?

    Read the article

  • Wait for all WPF animations to stop

    - by Ray
    Given a WPF window, which may or may not have animations, I'd like to wait until they are all done before continuing processing. Is there a generic way to do this. Currently I can do something like this: void WaitForAnimation(Storyboard storyboard) { WaitUntil(() => storyboard.GetCurrentState() == ClockState.Stopped); } But this assumes I know the storyboards or have some way of finding them. Is there a way of doing that?

    Read the article

  • Please wait screen in asp.net

    - by Zerotoinfinite
    Hi All, The home page of my website and some other page also are taking some time to load, instead of making them load fast, I want some please wait screen or progress bar and mean while the required page would be loaded behind. Is there any way to do it? Thanks in advance

    Read the article

  • Wait For Return Key Press Using Java Scanner

    - by Gordon
    What would be the best way to wait for a return key press from the user using the Java Scanner Class? In a command line tool I would like the user to confirm before carrying out an action. Please correct me if there a more standard way of doing this in a command line tool.

    Read the article

  • How can I wait for ABPeoplePickerNavigationController be dismissed

    - by user306804
    How can I wait for the contact to be chosen in my address book, before going on? Hereunder the code I use BPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init]; picker.peoplePickerDelegate = self; [self presentModalViewController:picker animated:YES]; //following code Right now it just proceeds with executing the code... Thanks

    Read the article

  • wait t time before launch an action ?

    - by Nanis
    Hi, I actually had a multiautocompletetextview, where i call host after 3 characters to have a dynamic search list. But if the user put others characters, my code call host for each of them. So it must be very long. Could I wait a moment (about 500 ms) before launching the action , in order to look if user do an action or not ? that's possible ?

    Read the article

  • controlling threads flow

    - by owca
    I had a task to write simple game simulating two players picking up 1-3 matches one after another until the pile is gone. I managed to do it for computer choosing random value of matches but now I'd like to go further and allow humans to play the game. Here's what I already have : http://paste.pocoo.org/show/201761/ Class Player is a computer player, and PlayerMan should be human being. Problem is, that thread of PlayerMan should wait until proper value of matches is given but I cannot make it work this way. Logic is as follows: thread runs until matches equals to zero. If player number is correct at the moment function pickMatches() is called. After decreasing number of matches on table, thread should wait and another thread should be notified. I know I must use wait() and notify() but I can't place them right. Class Shared keeps the value of current player, and also amount of matches. public void suspendThread() { suspended = true; } public void resumeThread() { suspended = false; } @Override public void run(){ int matches=1; int which = 0; int tmp=0; Shared data = this.selectData(); String name = this.returnName(); int number = this.getNumber(); while(data.getMatches() != 0){ while(!suspended){ try{ which = data.getCurrent(); if(number == which){ matches = pickMatches(); tmp = data.getMatches() - matches; data.setMatches(tmp, number); if(data.getMatches() == 0){ System.out.println(" "+ name+" takes "+matches+" matches."); System.out.println("Winner is player: "+name); stop(); } System.out.println(" "+ name+" takes "+matches+" matches."); if(number != 0){ data.setCurrent(0); } else{ data.setCurrent(1); } } this.suspendThread(); notifyAll(); wait(); }catch(InterruptedException exc) {} } } } @Override synchronized public int pickMatches(){ Scanner scanner = new Scanner(System.in); int n = 0; Shared data = this.selectData(); System.out.println("Choose amount of matches (from 1 to 3): "); if(data.getMatches() == 1){ System.out.println("There's only 1 match left !"); while(n != 1){ n = scanner.nextInt(); } } else{ do{ n = scanner.nextInt(); } while(n <= 1 && n >= 3); } return n; } }

    Read the article

  • Netstat shows numerous CLOSE_WAIT states for mysql connections

    - by Sudheer
    The output of netstat -an shows many mysql connections in CLOSE_WAIT state and when i checked the processlist in mysql using 'SHOW PROCESSLIST' the connections shown in netstat do not appear. What possible could be the reason for this. I use tomcat with mysql-connector and use a Connection Pool as well. Is it that the application is not closing the mysql connection or is there any other reason for this behaviour... sometimes the CLOSE_WAIT reaches over 200. On the application level i made sure that i close all the connections(make sure i issue a close() command in the finally block) created using jdbc. Any help would be appreciated.

    Read the article

  • merge() multiple data frames (do.call ?)

    - by Vincent
    Hi everyone, here's my very simple question: merge() only takes two data frames as input. I need to merge a series of data frames from a list, using the same keys for every merge operation. Given a list named "test", I want to do something like: do.call("merge", test). I could write some kind of loop, but I'm wondering if there's a standard or built-in way to do this more efficiently. Any advice is appreciated. Thanks! Here's a subset of the dataset in dput format (note that merging on country is trivial in this case, but that there are more countries in the original data): test <- list(structure(list(country = c("United States", "United States", "United States", "United States", "United States"), NY.GNS.ICTR.GN.ZS = c(13.5054687, 14.7608697, 14.1115876, 13.3389063, 12.9048351), year = c(2007, 2006, 2005, 2004, 2003)), .Names = c("country", "NY.GNS.ICTR.GN.ZS", "year"), row.names = c(NA, 5L), class = "data.frame"), structure(list( country = c("United States", "United States", "United States", "United States", "United States"), NE.TRD.GNFS.ZS = c(29.3459277, 28.352838, 26.9861939, 25.6231246, 23.6615328), year = c(2007, 2006, 2005, 2004, 2003)), .Names = c("country", "NE.TRD.GNFS.ZS", "year"), row.names = c(NA, 5L), class = "data.frame"), structure(list( country = c("United States", "United States", "United States", "United States", "United States"), NY.GDP.MKTP.CD = c(1.37416e+13, 1.31165e+13, 1.23641e+13, 1.16309e+13, 1.0908e+13), year = c(2007, 2006, 2005, 2004, 2003)), .Names = c("country", "NY.GDP.MKTP.CD", "year"), row.names = c(NA, 5L), class = "data.frame"))

    Read the article

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