InetAddressTrafficMonitor

class InetAddressTrafficMonitor<CP : ClientProt, Enum<CP>, SP : ServerProt, Enum<SP>, DC : Enum<DC>>(clientProts: Array<out CP>, serverProts: Array<out SP>, disconnectionReasons: Array<out DC>)

A traffic monitor for a specific java.net.InetAddress.

Constructors

Link copied to clipboard
constructor(clientProts: Array<out CP>, serverProts: Array<out SP>, disconnectionReasons: Array<out DC>)

Functions

Link copied to clipboard

Increments the specified reason for why a connection was lost to the specified java.net.InetAddress.

Link copied to clipboard
fun incrementIncomingPackets(opcode: Int, payloadSize: Int)

Increments the incoming packets received from this java.net.InetAddress.

Link copied to clipboard

Increments the outgoing packet opcode counter alone, without the payload increase. We require a special function for this since our JS5Service implementation fragments the payloads into blocks of X bytes. Due to the nature of it, we may only have a single packet header, but a hundred slices of that packet's payload.

Link copied to clipboard
fun incrementOutgoingPacketPayload(opcode: Int, payloadSize: Int)

Increments the outgoing packet payload sent to this java.net.InetAddress.

Link copied to clipboard
fun incrementOutgoingPackets(opcode: Int, payloadSize: Int)

Increments the outgoing packets sent to this java.net.InetAddress.

Link copied to clipboard

Captures a snapshot of the traffic in this channel since the last reset (or when it began measuring, if it has never been reset). This function will also reset the tracked metrics.