public static boolean canConnectUnixSocket ( File path ) { try ( UnixSocketChannel channel = UnixSocketChannel . open ( ) ) { return channel . connect ( new UnixSocketAddress ( path ) ) ; } catch ( IOException e ) { return false ; } }
Check whether we can connect to a local Unix socket