summaryrefslogtreecommitdiff
path: root/jsonrpc
diff options
context:
space:
mode:
Diffstat (limited to 'jsonrpc')
-rw-r--r--jsonrpc/src/main/java/com/orbekk/net/HttpUtil.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/jsonrpc/src/main/java/com/orbekk/net/HttpUtil.java b/jsonrpc/src/main/java/com/orbekk/net/HttpUtil.java
new file mode 100644
index 0000000..b4bb887
--- /dev/null
+++ b/jsonrpc/src/main/java/com/orbekk/net/HttpUtil.java
@@ -0,0 +1,26 @@
+package com.orbekk.net;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLConnection;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class HttpUtil {
+ private static final Logger logger =
+ LoggerFactory.getLogger(HttpUtil.class);
+
+ public static void sendHttpRequest(String url) {
+ try {
+ URL pingUrl = new URL(url);
+ pingUrl.openStream();
+ // URLConnection connection = pingUrl.openConnection();
+ // connection.connect();
+ } catch (MalformedURLException e) {
+ logger.warn("Unable to send ping to {}: {}.", url, e);
+ } catch (IOException e) {
+ logger.warn("Error when sending ping: {}", e);
+ }
+ }
+}