# Sandbox.Component.INetworkListener

A [Sandbox.Component](/api/Sandbox.Component) with this interface can react to network events.

- Kind: interface
- Assembly: `Sandbox.Engine`
- Modifiers: abstract

## Methods

- [`AcceptConnection`](/api/Sandbox.Component.INetworkListener/AcceptConnection): Called on the host to decide whether to accept a [Sandbox.Connection](/api/Sandbox.Connection). If any [Sandbox.Component](/api/Sandbox.Component) that implements this returns false, the connection will be denied.
- [`OnActive`](/api/Sandbox.Component.INetworkListener/OnActive): Called when someone is all loaded and entered the game. This will only be called for the host.
- [`OnBecameHost`](/api/Sandbox.Component.INetworkListener/OnBecameHost): The host left and you are the new host. The scene is already rebuilt from their snapshot; [Sandbox.Component.INetworkListener.OnDisconnected](/api/Sandbox.Component.INetworkListener/OnDisconnected) for them follows.
- [`OnConnected`](/api/Sandbox.Component.INetworkListener/OnConnected): Called when someone joins the server. This will only be called for the host.
- [`OnDisconnected`](/api/Sandbox.Component.INetworkListener/OnDisconnected): Called when someone leaves the server. This will only be called for the host.
- [`OnHostChanged`](/api/Sandbox.Component.INetworkListener/OnHostChanged): Another player took over as host and the scene was rebuilt from their snapshot. The new host gets [Sandbox.Component.INetworkListener.OnBecameHost](/api/Sandbox.Component.INetworkListener/OnBecameHost) instead.
