Open Asterune
NetworkService

NetworkService

Reports transport, connection state, traffic, and network timing.

Service
game:GetService("NetworkService")
Inherits
Instance
Replication
Never

Behavior

NetworkService reports transport, connection state, traffic, and network timing.

Summary

Members16
Properties10
  • ClientCount: number = 0parallel readread only

    The number of connected clients.

  • Connected: boolean = falseparallel readread only

    Whether the client currently has an active server connection.

  • Mode: string = "Offline"parallel readread only

    The active client, server, or standalone networking mode.

  • Ping: number = 0parallel readread only

    The measured connection round-trip time, in milliseconds.

  • Port: number = 0parallel readread only

    The network port used by the server.

  • ReceivedBytes: number = 0parallel readread only

    The cumulative number of bytes received.

  • SentBytes: number = 0parallel readread only

    The cumulative number of bytes sent.

  • ServerTickRate: number = 60parallel readread only

    The server's simulation tick rate.

  • ServerTime: number = 0parallel readread only

    The synchronized server time.

  • Transport: string = "offline"parallel readread only

    The active network transport identifier.

Methods5
Events1

Properties

ClientCount

NetworkService.ClientCount: number = 0

The number of connected clients.

Connected

NetworkService.Connected: boolean = false

Whether the client currently has an active server connection.

Mode

NetworkService.Mode: string = "Offline"

The active client, server, or standalone networking mode.

Ping

NetworkService.Ping: number = 0

The measured connection round-trip time, in milliseconds.

Port

NetworkService.Port: number = 0

The network port used by the server.

ReceivedBytes

NetworkService.ReceivedBytes: number = 0

The cumulative number of bytes received.

SentBytes

NetworkService.SentBytes: number = 0

The cumulative number of bytes sent.

ServerTickRate

NetworkService.ServerTickRate: number = 60

The server's simulation tick rate.

ServerTime

NetworkService.ServerTime: number = 0

The synchronized server time.

Transport

NetworkService.Transport: string = "offline"

The active network transport identifier.

Methods

GetClientCount

NetworkService:GetClientCount(): number

Returns the number of connected network clients.

GetConnectionQuality

NetworkService:GetConnectionQuality(player: Player?): ConnectionQuality

Returns "Excellent", "Good", "Fair", "Poor", or "Bad", or nil when no connection matches. Accepts a Player, user identifier, or no argument. With no argument, a client uses its server connection; a server selects its worst connection.

GetConnections

NetworkService:GetConnections(): table

Returns information about the active network connections.

GetExecutionGroup

NetworkService:GetExecutionGroup(): ExecutionGroup?

Returns this instance if it is an ExecutionGroup. Otherwise returns the nearest ancestor ExecutionGroup, or nil when no group contains the instance.

GetStats

NetworkService:GetStats(): table

Returns network traffic and timing statistics.

Events

ConnectionChanged

NetworkService.ConnectionChanged: RBXScriptSignal

Fires when the network connection state changes.

Inherited members

Inherited47

Instance