/** * Accepts a connection.<br> * <b>Notice:</b> This method can be called only once. It will throw SocksException if this method * is called more than once. */ @Override public synchronized Socket accept() throws SocksException, IOException { if (alreadyAccepted) { throw new SocksException("SOCKS4/SOCKS5 protocol only allows one income connection"); } alreadyAccepted = true; return proxy.accept(); }
/** * Accepts a connection.<br> * <b>Notice:</b> This method can be called only once. It will throw SocksException if this method * is called more than once. */ @Override public synchronized Socket accept() throws SocksException, IOException { if (alreadyAccepted) { throw new SocksException("SOCKS4/SOCKS5 protocol only allows one income connection"); } alreadyAccepted = true; return proxy.accept(); }