Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NetworkManager.getInstance().killAndWait(request) freezes Device and simulator #733

Closed
codenameone opened this issue Mar 27, 2015 · 5 comments

Comments

@codenameone
Copy link
Collaborator

Original issue 733 created by codenameone on 2013-06-07T17:03:29.000Z:

It relates to the simulators as well as my Sony Xperia mirror device(the only android device I tested on) as well as Blackberry Bold 6 device.

What steps will reproduce the problem?

  1. Using a command on the back button to kill a connection request
  2. if it is taking long to get response from a connection, cancel the request and the request will not cancel then the device/simulator freezes or continue running the infinite progress without stopping
    3.

What is the expected output? What do you see instead?

---The expected output is for the request to cancel and allow me to continue other things but the device freezes instead.

What version of the product are you using? On what operating system?

---I use the latest version because I updated today. I am running it on Linux OS.

Please provide any additional information below.

@codenameone
Copy link
Collaborator Author

Comment #1 originally posted by codenameone on 2013-06-08T08:37:07.000Z:

I'm marking this as Won't Fix until we get code to reproduce the issue

@codenameone
Copy link
Collaborator Author

Comment #2 originally posted by codenameone on 2013-06-10T06:20:52.000Z:

This is the code I used

private void fetchTopTenTunes() {

    final ConnectionRequest request = new ConnectionRequest() {
        @Override
        protected void readHeaders(Object connection) throws IOException {

            status = getHeader(connection, null);
            // System.out.println("The status of the connection: " + status);
        }
        //*****************

        @Override
        protected void readResponse(InputStream input) throws IOException {

            JSONParser p = new JSONParser();
            InputStreamReader inp = new InputStreamReader(input);
            Hashtable h = p.parse(inp);
            allTopTunes = (Vector<Hashtable>) h.get("root");
            //System.out.println(h.toString());

        }
    };

    final NetworkManager manager = NetworkManager.getInstance();
    Command c = new Command("Cancel") {
        @Override
        public void actionPerformed(ActionEvent evt) {
            manager.killAndWait(request);

        }
    };

    InfiniteProgress ip = new InfiniteProgress();
    //Dialog dlg = ip.showInifiniteBlocking();
    Dialog d = new Dialog();
    d.setDialogUIID("Container");
    d.setLayout(new BorderLayout());
    Container cnt = new Container(new BoxLayout(BoxLayout.Y_AXIS));
    Label l = new Label("fetching...");
    l.getStyle().getBgTransparency();
    cnt.addComponent(l);
    cnt.addComponent(ip);
    d.addComponent(BorderLayout.CENTER, cnt);
    d.setTransitionInAnimator(CommonTransitions.createEmpty());
    d.setTransitionOutAnimator(CommonTransitions.createEmpty());
    d.showPacked(BorderLayout.CENTER, false);
    d.setBackCommand(c);


    String url = "http://www.my_url.com";
    request.setUrl(url);

    request.setFailSilently(true);//stops user from seeing error message on failure
    request.setPost(false);
    request.setDuplicateSupported(true);
    //request.setTimeout(2000);
    request.setDisposeOnCompletion(d);


    // NetworkManager manager = NetworkManager.getInstance();
    manager.start();
    manager.setTimeout(2000);
    manager.addToQueueAndWait(request);
}

@codenameone
Copy link
Collaborator Author

Comment #3 originally posted by codenameone on 2013-06-12T10:52:40.000Z:

Assigning to Chen to try and reproduce

@codenameone
Copy link
Collaborator Author

Comment #4 originally posted by codenameone on 2013-06-13T14:08:33.000Z:

fixed in svn, thanks.
will be available in the next server update

@codenameone
Copy link
Collaborator Author

Comment #5 originally posted by codenameone on 2013-06-13T14:21:34.000Z:

very glad to know. can't wait for the update.

@codenameone codenameone removed their assignment Jul 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

0 participants