The java application I'm working on is having some problems when connecting to pushwoosh server. A ConnectionException is thrown with some frequency, and it has been growing for the past 2 weeks.

Number of ConnectionException
The tallest bar indicates 677 events

The code I'm using is basically this:

URL url = new URL("https://cp.pushwoosh.com/json/1.3/createMessage");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("POST");
connection.setRequestProperty("Content-Type", "application/json");
connection.setDoInput(true);
connection.setDoOutput(true);
DataOutputStream writer = new DataOutputStream(connection.getOutputStream()); // exception thrown here
writer.write(request.getBytes("UTF-8"));
writer.flush();
writer.close();

How can I ensure the connection with the pushwoosh server? I thought about retrying the connection, but I'm afraid it could overload, instead of resolving the problem.

asked 29 Apr '16, 20:17
andrewmat's gravatar image

andrewmat
213

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×91
×52
×30

question asked: 29 Apr '16, 20:17

question was seen: 1,067 times

last updated: 29 Apr '16, 20:17