Skip to content

Hang when trying to get InputStream from url #178

@wkit23

Description

@wkit23

I'm facing a very odd case. Referring to the following code:

var url = java.import('java.net.URL');
var input = new url('http://localhost:3000/api/Quote/5490e46e500eb13c1e4ea0d1');
var con = input.openConnectionSync();
con.setConnectTimeout(10000);
con.setReadTimeout(10000);
var stream = con.getInputStreamSync();

Based on the code, there should not have issue right? However, the function always timed out (and hang if I didn't set the timeout). I can confirm that the url has no problem as I can open the page. I've even tried create the program in java and confirm no issue.

Any ideas? There isn't any error but it just doesn't give me the InputStream as I would needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions