The MongoDB\Driver\Monitoring\ServerClosedEvent class

- « MongoDB\Driver\Monitoring\ServerChangedEvent::getTopologyId

- MongoDB\Driver\Monitoring\ServerClosedEvent::getHost »

- PHP Manual
- MongoDB\Driver\Monitoring
- The MongoDB\Driver\Monitoring\ServerClosedEvent class

# The MongoDB\Driver\Monitoring\ServerClosedEvent class

(mongodb >=1.13.0)

## Introduction

The MongoDB\Driver\Monitoring\ServerClosedEvent class encapsulates information about a closed server. This corresponds to an existing server being removed from the topology.

## Class synopsis

final class MongoDB\Driver\Monitoring\ServerClosedEvent {
/* Methods */
final public getHost(): string
final public getPort(): int
final public getTopologyId(): MongoDB\BSON\ObjectId
}

## Table of Contents

- MongoDB\Driver\Monitoring\ServerClosedEvent::getHost — Returns the hostname of the server
- MongoDB\Driver\Monitoring\ServerClosedEvent::getPort — Returns the port on which this server is listening
- MongoDB\Driver\Monitoring\ServerClosedEvent::getTopologyId — Returns the topology ID associated with this server