vertx / io.vertx.core.spi.metrics / TCPMetrics

# TCPMetrics

`interface TCPMetrics<S : Any> : NetworkMetrics<S>`

An SPI used internally by Vert.x to gather metrics on a net socket which serves as a base class for things like HttpServer and HttpClient, all of which serve TCP connections. The thread model for the tcp metrics depends on the actual context thats created the client/server. Event loop context Unless specified otherwise, all the methods on this object including the methods inherited from the super interfaces are invoked with the thread of the client/server and therefore are the same than the io.vertx.core.spi.metrics.VertxMetrics `createMetrics` method that created and returned this metrics object. Worker context Unless specified otherwise, all the methods on this object including the methods inherited from the super interfaces are invoked with a worker thread.

Author
Nick Scavelli

### Functions

connected | `abstract fun connected(remoteAddress: SocketAddress, remoteName: String): S` Called when a client has connected, which is applicable for TCP connections. The remote name of the client is a best effort to provide the name of the remote host, i.e if the name is specified at creation time, this name will be used otherwise it will be the remote address.
disconnected | `abstract fun disconnected(socketMetric: S, remoteAddress: SocketAddress): Unit` Called when a client has disconnected, which is applicable for TCP connections.