void cacheAddress ( Name hostName, NbtAddress addr, long expiration ) { if ( this.transportContext.getConfig().getNetbiosCachePolicy() == 0 ) { return; } synchronized ( this.addressCache ) { CacheEntry entry = this.addressCache.get(hostName); if ( entry == null ) { entry = new CacheEntry(hostName, addr, expiration); this.addressCache.put(hostName, entry); } else { entry.address = addr; entry.expiration = expiration; } } }
this.unknownName = new Name(tc.getConfig(), "0.0.0.0", 0x00, null); this.unknownAddress = new NbtAddress(this.unknownName, 0, false, NbtAddress.B_NODE); this.addressCache.put(this.unknownName, new CacheEntry(this.unknownName, this.unknownAddress, SmbConstants.FOREVER));
this.unknownName = new Name(tc.getConfig(), "0.0.0.0", 0x00, null); this.unknownAddress = new NbtAddress(this.unknownName, 0, false, NbtAddress.B_NODE); this.addressCache.put(this.unknownName, new CacheEntry(this.unknownName, this.unknownAddress, SmbConstants.FOREVER));
void cacheAddressArray ( NbtAddress[] addrs ) { if ( this.transportContext.getConfig().getNetbiosCachePolicy() == 0 ) { return; } long expiration = -1; if ( this.transportContext.getConfig().getNetbiosCachePolicy() != SmbConstants.FOREVER ) { expiration = System.currentTimeMillis() + this.transportContext.getConfig().getNetbiosCachePolicy() * 1000; } synchronized ( this.addressCache ) { for ( int i = 0; i < addrs.length; i++ ) { CacheEntry entry = this.addressCache.get(addrs[ i ].hostName); if ( entry == null ) { entry = new CacheEntry(addrs[ i ].hostName, addrs[ i ], expiration); this.addressCache.put(addrs[ i ].hostName, entry); } else { entry.address = addrs[ i ]; entry.expiration = expiration; } } } }
void cacheAddressArray ( NbtAddress[] addrs ) { if ( this.transportContext.getConfig().getNetbiosCachePolicy() == 0 ) { return; } long expiration = -1; if ( this.transportContext.getConfig().getNetbiosCachePolicy() != SmbConstants.FOREVER ) { expiration = System.currentTimeMillis() + this.transportContext.getConfig().getNetbiosCachePolicy() * 1000; } synchronized ( this.addressCache ) { for ( int i = 0; i < addrs.length; i++ ) { CacheEntry entry = this.addressCache.get(addrs[ i ].hostName); if ( entry == null ) { entry = new CacheEntry(addrs[ i ].hostName, addrs[ i ], expiration); this.addressCache.put(addrs[ i ].hostName, entry); } else { entry.address = addrs[ i ]; entry.expiration = expiration; } } } }
void cacheAddress ( Name hostName, NbtAddress addr, long expiration ) { if ( this.transportContext.getConfig().getNetbiosCachePolicy() == 0 ) { return; } synchronized ( this.addressCache ) { CacheEntry entry = this.addressCache.get(hostName); if ( entry == null ) { entry = new CacheEntry(hostName, addr, expiration); this.addressCache.put(hostName, entry); } else { entry.address = addr; entry.expiration = expiration; } } }