Code example for UnknownServiceException

0
    } 
 
    @Override 
    protected void accept(SocketImpl s) throws IOException {
        if (!(s instanceof LocalSocketImpl)) {
            throw new UnknownServiceException();
        } 
        ((LocalSocketImpl)s).socket = nativeAccept(this.socket);
        ((LocalSocketImpl)s).connected = true;
        ((LocalSocketImpl)s).endpoint = endpoint;
    } 
 
    @Override 
    protected int available() throws IOException {
        return nativeAvailable(socket);
    } 
 
    @Override 
    protected void bind(InetAddress host, int port) throws IOException {
        throw new UnknownServiceException();