class DefaultSocks5ConnectionsRegistry implements Socks5ConnectionsRegistry {

    public Socks5Pair register(String hash, IoSession session) {
        Socks5Pair pair = pairs.get(hash);
        if(pair == null) {
            // new pair, this must be the target
            pair = new Socks5Pair(session, this, hash);
            pairs.put(hash, pair);
        } else {
            // update pair
            pair.setRequester(session);
        }
        
        return pair;
    }

}