Delete multiple socket fds from a room.

@param int fd
@param array|string rooms
182337
public function delete(int $fd, $rooms)
    {
        $rooms = is_array($rooms) ? $rooms : [$rooms];
        $rooms = count($rooms) ? $rooms : $this->getRooms($fd);

        $this->removeValue($fd, $rooms, RoomContract::DESCRIPTORS_KEY);

        foreach ($rooms as $room) {
            $this->removeValue($room, [$fd], RoomContract::ROOMS_KEY);
        }
    }
473304
public function deleteLocation($locations)
     {
         $delete_ids = (array) AnConfig::unbox($locations->id);

         foreach ($this->locations as $location) {
             if (in_array($location->id, $delete_ids)) {
                 if ($edge = $this->locations->find($location)) {
                     $edge->delete();
                 }
             }
         }
     }
383403
public function delete($keys)
    {
        $keys = (array) $keys;

        foreach ($keys as $key) {
            if ($this->exists($this->items, $key)) {
                unset($this->items[$key]);

                continue;
            }

            $items = &$this->items;
            $segments = explode('.', $key);
            $lastSegment = array_pop($segments);

            foreach ($segments as $segment) {
                if (!isset($items[$segment]) || !is_array($items[$segment])) {
                    continue 2;
                }

                $items = &$items[$segment];
            }

            unset($items[$lastSegment]);
        }
    }
797245
void removeClient(ClientSocket client)
    {
        if (client != null)
        {
            toRemove.add(client);
            client.terminate();
            clientsNumber--;
            willRemove = true;
            Verbose.info(SERVER, client.getName(), " disconnected");
        }
    }
324778
def _leave_unused_rooms(self, _address_to_room_ids: Dict[AddressHex, List[_RoomID]]):
        
        _msg = '_leave_unused_rooms called without account data lock'
        assert self._account_data_lock.locked(), _msg

        # TODO: Remove the next five lines and check if transfers start hanging again
        self._client.set_account_data(
            'network.raiden.rooms',  # back from cast in _set_room_id_for_address
            cast(Dict[str, Any], _address_to_room_ids),
        )
        return

        # cache in a set all whitelisted addresses
        whitelisted_hex_addresses: Set[AddressHex] = {
            to_checksum_address(address)
            for address in self._address_mgr.known_addresses
        }

        keep_rooms: Set[_RoomID] = set()

        for address_hex, room_ids in list(_address_to_room_ids.items()):
            if not room_ids:  # None or empty
                room_ids = list()
            if not isinstance(room_ids, list):  # old version, single room
                room_ids = [room_ids]

            if address_hex not in whitelisted_hex_addresses:
                _address_to_room_ids.pop(address_hex)
                continue

            counters = [0, 0]  # public, private
            new_room_ids: List[_RoomID] = list()

            # limit to at most 2 public and 2 private rooms, preserving order
            for room_id in room_ids:
                if room_id not in self._client.rooms:
                    continue
                elif self._client.rooms[room_id].invite_only is None:
                    new_room_ids.append(room_id)  # not known, postpone cleaning
                elif counters[self._client.rooms[room_id].invite_only] < 2:
                    counters[self._client.rooms[room_id].invite_only] += 1
                    new_room_ids.append(room_id)  # not enough rooms of this type yet
                else:
                    continue  # enough rooms, leave and clean

            keep_rooms |= set(new_room_ids)
            if room_ids != new_room_ids:
                _address_to_room_ids[address_hex] = new_room_ids

        rooms: List[Tuple[_RoomID, Room]] = list(self._client.rooms.items())

        self.log.debug(
            'Updated address room mapping',
            address_to_room_ids=_address_to_room_ids,
        )
        self._client.set_account_data('network.raiden.rooms', _address_to_room_ids)

        def leave(room: Room):
            """A race between /leave and /sync may remove the room before
            del on _client.rooms key. Suppress it, as the end result is the same: no more room"""
            try:
                self.log.debug('Leaving unused room', room=room)
                return room.leave()
            except KeyError:
                return True

        for room_id, room in rooms:
            if room_id in {groom.room_id for groom in self._global_rooms.values() if groom}:
                # don't leave global room
                continue
            if room_id not in keep_rooms:
                greenlet = self._spawn(leave, room)
                greenlet.name = (
                    f'MatrixTransport.leave '
                    f'node:{pex(self._raiden_service.address)} '
                    f'user_id:{self._user_id}'
                )
1274015
public void removeChannel(
            T channel,
            String functionalityName,
            String requesterID,
            String conversationID)
    {
        synchronized (this.channelsWithId)
        {
            this.channelsWithId.remove(calculateId(functionalityName, requesterID, conversationID));
        }
        synchronized (this.channelsWithFunctionalityName)
        {
            this.channelsWithFunctionalityName.get(functionalityName).remove(channel);
        }
    }
192366
protected function setRooms(int $fd, array $rooms): TableRoom
    {
        return $this->setValue($fd, $rooms, RoomContract::DESCRIPTORS_KEY);
    }
968789
public static void deleteIfExists(FileSystem fs, Path path, boolean recursive) throws IOException {
    if (fs.exists(path)) {
      deletePath(fs, path, recursive);
    }
  }
1106394
public function del($fd, $flag)
    {
        switch ($flag) {
            case static::EV_READ:
            case static::EV_WRITE:
                $fd_key    = (int)$fd;
                if(isset($this->fdEvents[$fd_key][$flag])){
                    $this->fdEvents[$fd_key][$flag]->del();
                    $this->fdEvents[$fd_key][$flag]->free();
                    unset($this->fdEvents[$fd_key][$flag]);
                }
            case static::EV_SIGNAL:
                if(isset($this->signalEvents[$fd])) {
                    $this->signalEvents[$fd]->del();
                    $this->signalEvents[$fd]->free();
                    unset($this->signalEvents[$fd]);
                }
                break;
            case static::EV_INTERVAL:
            case static::EV_TIMEOUT:
                if(isset($this->timerEvents[$fd])) {
                    static::unsetId($fd);
                    $this->timerEvents[$fd]->del();
                    $this->timerEvents[$fd]->free();
                    unset($this->timerEvents[$fd]);
                }
                
                break;
                
        }
    }
1288729
def destroy_channels(self):
        """"""
        for item_name in dir(self):
            item = getattr(self, item_name)
            if isinstance(item, self.RedisAtomicBase):
                self.redis.delete(item.item_name)
1285468
public function deleteMultiple( $keys )
	{
		foreach( $keys as $key ) {
			$this->object->remove( $this->prefix . $key );
		}
	}
1164135
function del(keys, cb){
  if(!keys || keys.length<=0){
    if(cb) return cb(new Error('empty key'));
    else throw new Error('empty key');
  }
  var fns = [];
  for(var j in this._stores){
    var store = this._stores[j];
    fns.push(store.del.bind(store, keys));
  }
  if(cb){
    concurrent(fns, cb);
  }else{
    var fiber = fibext(), rbw = false;
    concurrent(fns, function(){
      fiber.resume.apply(fiber, arguments);
      rbw = true;
    });
    rbw || fiber.wait();
  }
}
1049650
function close($socket) {
		if (isset($this->agents[(int)$socket]))
			unset($this->sockets[(int)$socket],$this->agents[(int)$socket]);
		stream_socket_shutdown($socket,STREAM_SHUT_WR);
		@fclose($socket);
	}
1357565
@Override
    public void destroy(SocketDestination dest, ClientRequestExecutor clientRequestExecutor)
            throws Exception {
        clientRequestExecutor.close();
        int numDestroyed = destroyed.incrementAndGet();
        if(stats != null) {
            stats.incrementCount(dest, ClientSocketStats.Tracked.CONNECTION_DESTROYED_EVENT);
        }

        if(logger.isDebugEnabled())
            logger.debug("Destroyed socket " + numDestroyed + " connection to " + dest.getHost()
                         + ":" + dest.getPort());
    }
641543
protected function cleanRooms(): void
    {
        if (count($keys = $this->redis->keys("{$this->prefix}*"))) {
            $this->redis->del($keys);
        }
    }
655793
public static void delete(FileSystem fs, String name) throws IOException {
    Path dir = new Path(name);
    Path data = new Path(dir, DATA_FILE_NAME);
    Path index = new Path(dir, INDEX_FILE_NAME);

    fs.delete(data, true);
    fs.delete(index, true);
    fs.delete(dir, true);
  }
503192
function remove(connection, connections) {
  for (var i = 0; i < connections.length; i++) {
    if (connections[i] === connection) {
      connections.splice(i, 1);
      return true;
    }
  }
}