Skip to content

Commit 9909046

Browse files
committed
Move DnsResolver to org.java_websocket.client and fix code style
1 parent b88de91 commit 9909046

File tree

3 files changed

+29
-31
lines changed

3 files changed

+29
-31
lines changed

src/main/java/org/java_websocket/DnsResolver.java

Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package org.java_websocket.client;
2+
3+
import java.net.InetAddress;
4+
import java.net.URI;
5+
import java.net.UnknownHostException;
6+
7+
/**
8+
* Users may implement this interface to override the default DNS lookup offered
9+
* by the OS.
10+
*
11+
* @since 1.4.1
12+
*/
13+
public interface DnsResolver {
14+
15+
/**
16+
* Resolves the IP address for the given URI.
17+
*
18+
* This method should never return null. If it's not able to resolve the IP
19+
* address then it should throw an UnknownHostException
20+
*
21+
* @param uri The URI to be resolved
22+
*
23+
* @return The resolved IP address
24+
*
25+
* @throws UnknownHostException if no IP address for the <code>uri</code> could be found.
26+
*/
27+
InetAddress resolve(URI uri) throws UnknownHostException;
28+
29+
}

src/main/java/org/java_websocket/client/WebSocketClient.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
import javax.net.ssl.SSLSocketFactory;
4949

5050
import org.java_websocket.AbstractWebSocket;
51-
import org.java_websocket.DnsResolver;
5251
import org.java_websocket.WebSocket;
5352
import org.java_websocket.WebSocketImpl;
5453
import org.java_websocket.drafts.Draft;

0 commit comments

Comments
 (0)