Class Server
Generic class which establishes a socket connection to receive data over the network.
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: IMLD.MixedRealityAnalysis.Network
Assembly: Assembly-CSharp.dll
Syntax
public abstract class Server : IDisposable
Constructors
Server(Int32)
Initializes a new instance of the Server class.
Declaration
public Server(int port)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | port | The port the server will be listening on. |
Fields
port
Declaration
protected int port
Field Value
Type | Description |
---|---|
System.Int32 |
Properties
IsListening
Gets a value indicating whether the receiver is currently listening for incoming data or not.
Declaration
public abstract bool IsListening { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Port
Gets the port the receiver listens for incoming data.
Declaration
public int Port { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
Dispose()
Disposes this object.
Declaration
public virtual void Dispose()
OnDataReceived(IPEndPoint, Byte[])
Raises the DataReceived event.
Declaration
protected virtual void OnDataReceived(IPEndPoint remoteEndPoint, byte[] data)
Parameters
Type | Name | Description |
---|---|---|
System.Net.IPEndPoint | remoteEndPoint | The remote end point of the data transfer. |
System.Byte[] | data | The network data. |
Start()
Start the server, which will try to listen for incoming data on the specified port.
Declaration
public abstract bool Start()
Returns
Type | Description |
---|---|
System.Boolean |
Stop()
Stops the server if it is currently running, freeing the specified port.
Declaration
public abstract void Stop()
Events
DataReceived
Called when the server received data from a client.
Declaration
public event ByteDataHandler DataReceived
Event Type
Type | Description |
---|---|
ByteDataHandler |
Implements
System.IDisposable