Code example for UnknownServiceException

0
        return impl.getSocketAddress();
    } 
     
    @Override 
    public void bind(SocketAddress bindpoint) throws IOException {
        throw new UnknownServiceException();
    } 
     
    @Override 
    public SocketChannel getChannel()  {
        return null; 
    } 
     
    @Override 
    public InetAddress getInetAddress() {
        if (!isConnected()) { 
            return null; 
        } 
        throw new IllegalArgumentException("Unsupported address type");
    }