public class SocketFactory extends Object
Modifier and Type | Method and Description |
---|---|
static SSLSocket |
createAllTrustSSLSocket(String hostName,
int port)
Create ssl client socket which trust all certificates.
|
static Socket |
createClientSocket(String hostName,
int port)
Create non ssl client socket.
|
static ServerSocket |
createServerSocket(String hostName,
int port)
Create non sll server socket.
|
static SSLServerSocket |
createSSLServerSocket(String hostName,
int port,
KeyManager[] keyManagers)
Create ssl server socket.
|
public static ServerSocket createServerSocket(String hostName, int port) throws IOException
hostName
- port
- IOException
public static SSLServerSocket createSSLServerSocket(String hostName, int port, KeyManager[] keyManagers) throws IOException, KeyManagementException, NoSuchAlgorithmException
hostName
- port
- keyManagers
- IOException
KeyManagementException
NoSuchAlgorithmException
public static Socket createClientSocket(String hostName, int port) throws IOException, UnknownHostException
hostName
- port
- IOException
UnknownHostException
public static SSLSocket createAllTrustSSLSocket(String hostName, int port) throws IOException, UnknownHostException, KeyManagementException, NoSuchAlgorithmException
hostName
- port
- IOException
UnknownHostException
KeyManagementException
NoSuchAlgorithmException
Copyright © 2013. All Rights Reserved.