Class NetworkServer
Start the servers needed for the tcp connection. UDP listener responds with the TCP IP address and port of the server.
Inherited Members
Namespace: HoloMetrix.Net.Remote
Assembly: HoloMetrix.Net.Remote.dll
Syntax
public class NetworkServer
Constructors
| Improve this Doc View SourceNetworkServer(int)
Initializes a new instance of the NetworkServer class.
Declaration
public NetworkServer(int tcpPort = 51051)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tcpPort | The tcp port to use for data communication. |
Properties
| Improve this Doc View SourceIsBluetoothRunning
Gets a value indicating whether the Bluetooth service is running.
Declaration
public bool IsBluetoothRunning { get; }
Property Value
| Type | Description |
|---|---|
| bool |
TCPPort
Gets the tcp port that the server listens on for incoming connections.
Declaration
public int TCPPort { get; }
Property Value
| Type | Description |
|---|---|
| int |
UDPPort
Gets the port that receives UDP broadcast messages. This is used to request the tcp address.
Declaration
public int UDPPort { get; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
| Improve this Doc View SourceStartServers(int?)
Start the UDP listener to receive broadcast messages. Start the TCP listener to accept incoming connections. Start the Bluetooth service.
Declaration
public void StartServers(int? broadcastPort = null)
Parameters
| Type | Name | Description |
|---|---|---|
| int? | broadcastPort |
StopAllServices()
Stops all active network services (TCP, UDP, Bluetooth).
Declaration
public void StopAllServices()
Events
| Improve this Doc View SourceConnectionEstablished
Event raised when a client connects to the server.
Declaration
public event Action ConnectionEstablished
Event Type
| Type | Description |
|---|---|
| Action |
ConnectionLost
Event raised when the network connection is lost.
Declaration
public event Action ConnectionLost
Event Type
| Type | Description |
|---|---|
| Action |