Downloading csv file from website regularly with network library failing with broken pipe socket exception
in
Core Library Questions
•
1 year ago
Hi All,
I am trying to download a csv file from a website at regular intervals. I do this with the following code (that is in a function that is called every 5 seconds):
cl.write("GET http://go.vumi.org/dashboard/poll-00e8b40c172b4575b260968e2bb0d970/users.csv\r\n");
cl.write("\r\n");
The cl client is instantiated in setup. The first time this file is downloaded succesfully (it gets the data) but then I get this error: "java.net.SocketException: Broken pipe" and every subsequent attempt to write to the client fails. I have read that this socket exception implies that the connection has been broken so my attempt to solve this was to instantiate the client each time the function gets called (as opposed to just once in the set up). However this just does nothing at the moment - i.e not even the first file download from the website works.
Any suggestions as to how to deal with this please?
I am trying to download a csv file from a website at regular intervals. I do this with the following code (that is in a function that is called every 5 seconds):
cl.write("GET http://go.vumi.org/dashboard/poll-00e8b40c172b4575b260968e2bb0d970/users.csv\r\n");
cl.write("\r\n");
The cl client is instantiated in setup. The first time this file is downloaded succesfully (it gets the data) but then I get this error: "java.net.SocketException: Broken pipe" and every subsequent attempt to write to the client fails. I have read that this socket exception implies that the connection has been broken so my attempt to solve this was to instantiate the client each time the function gets called (as opposed to just once in the set up). However this just does nothing at the moment - i.e not even the first file download from the website works.
Any suggestions as to how to deal with this please?
1