Re: AsyncHTTPClient crashes saying invalid http version

2020-04-17 Thread dom96
Stop mixing callbacks and async procs. Your `download` async proc finishes before your download operation finishes because you are not awaiting the `download` proc. Just do this: await downloader.downloadFile(node.mediaLink(board, thread), downFileName) Run

Re: AsyncHTTPClient crashes saying invalid http version

2020-04-17 Thread adnan
> Is this a wrong link? because that doesn't look synchronous. Ops sorry I had changed the link. > One important thing to know is that you should never use waitFor in an async > procedure, use await. If I use await, the main thread doesn't stop until all the coroutines I create inside the

Re: AsyncHTTPClient crashes saying invalid http version

2020-04-17 Thread adnan
> To keep multiple connections open at a time you will need a separate > HttpClient for each. Ah that fixes it. Thanks a bunch.

Re: AsyncHTTPClient crashes saying invalid http version

2020-04-17 Thread dom96
> Writing a synchronous downloader script was a breeze: > [https://gitlab.com/snippets/1967018](https://gitlab.com/snippets/1967018) Is this a wrong link? because that doesn't look synchronous. You're doing a number of things incorrectly here. One important thing to know is that you should

Re: AsyncHTTPClient crashes saying invalid http version

2020-04-17 Thread geotre
To keep multiple connections open at a time you will need a separate HttpClient for each. Try moving webClient = newAsyncHttpClient() into the for loop so each call to webClient.downloadFile has it's own client

AsyncHTTPClient crashes saying invalid http version

2020-04-17 Thread adnan
Hi, I'm still trying to figure out async/await. I am writing a script that parses a json returned by a forum API and tries to download all the files described by the json. Writing a synchronous downloader script was a breeze: