public final class SocketUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
private static org.slf4j.Logger |
logger |
| Constructor and Description |
|---|
SocketUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
closeQuietly(ServerSocket serverSocket) |
static void |
closeQuietly(Socket socket) |
static ServerSocket |
createServerSocket(int port,
ServerSocketConfiguration config)
Returns a
ServerSocket for the given port and configuration. |
static Socket |
createSocket(InetSocketAddress address,
SocketConfiguration config)
Returns a
Socket (effectively used as a client socket) for the given address and configuration. |
static SSLServerSocket |
createSSLServerSocket(int port,
ServerSocketConfiguration serverSocketConfiguration)
Returns a
SSLServerSocket for the given port and configuration. |
public static Socket createSocket(InetSocketAddress address, SocketConfiguration config) throws IOException
Socket (effectively used as a client socket) for the given address and configuration.address - the InetSocketAddress for the socket (used for hostname and port)config - the SocketConfigurationIOException - if there is a problem creating the socketpublic static ServerSocket createServerSocket(int port, ServerSocketConfiguration config) throws IOException, TlsException
ServerSocket for the given port and configuration.port - the port for the socketconfig - the ServerSocketConfigurationIOException - if there is a problem creating the socketTlsException - if there is a problem creating the socketpublic static SSLServerSocket createSSLServerSocket(int port, ServerSocketConfiguration serverSocketConfiguration) throws TlsException
SSLServerSocket for the given port and configuration.port - the port for the socketserverSocketConfiguration - the ServerSocketConfigurationTlsException - if there was a problem creating the socketpublic static void closeQuietly(Socket socket)
public static void closeQuietly(ServerSocket serverSocket)
Copyright © 2023 Apache NiFi Project. All rights reserved.