Class NetSocketTcpScenarioReceiver
Inheritance
NetSocketTcpScenarioReceiver
Assembly: Xareus.Scenarios.Network.dll
Syntax
public class NetSocketTcpScenarioReceiver : INetSocketTcp, IDisposable
Constructors
NetSocketTcpScenarioReceiver()
Declaration
public NetSocketTcpScenarioReceiver()
NetSocketTcpScenarioReceiver(Scenario)
Create a receiver with a scenario to handle incoming data from
Declaration
public NetSocketTcpScenarioReceiver(Scenario scenario)
Parameters
Fields
client
Declaration
protected TcpClient client
Field Value
Properties
IsConnected
Declaration
public bool IsConnected { get; }
Property Value
IsReceiving
Declaration
public bool IsReceiving { get; set; }
Property Value
OnConnected
Event handler for connection
Declaration
public EventHandler OnConnected { get; set; }
Property Value
OnDisconnected
Event handler for disconnection
Declaration
public EventHandler OnDisconnected { get; set; }
Property Value
OnReceivedScenario
Declaration
public EventHandler<ScenarioLoadedEventArgs> OnReceivedScenario { get; set; }
Property Value
OnReceivedScenarioList
Declaration
public EventHandler<string[]> OnReceivedScenarioList { get; set; }
Property Value
Scenarios
Declaration
public Dictionary<string, Scenario> Scenarios { get; }
Property Value
Methods
Close()
Declaration
Connect(string, int)
Connect to the given server and start receiving data
Declaration
public void Connect(string hostAddress, int port = 7777)
Parameters
Type |
Name |
Description |
string |
hostAddress |
|
int |
port |
|
ConvertFromParameter(Parameter, Type, IContext)
Declaration
protected virtual object ConvertFromParameter(Parameter parameterData, Type dataType, IContext externalContext)
Parameters
Returns
ConvertFromParameter<T>(Parameter, IContext)
Declaration
protected virtual T ConvertFromParameter<T>(Parameter parameterData, IContext externalContext)
Parameters
Returns
Type Parameters
Disconnect()
Tell the server we are disconnecting
Declaration
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
Dispose(bool)
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type |
Name |
Description |
bool |
disposing |
|
RegisterToScenario(Scenario)
Add a scenario the receiver will handle the incoming data from
Declaration
public void RegisterToScenario(Scenario scenario)
Parameters
RegisterToScenarioUpdate(string, bool)
Declaration
public void RegisterToScenarioUpdate(string scenarioInstanceId, bool registerToTransitionFiredEvents = false)
Parameters
Type |
Name |
Description |
string |
scenarioInstanceId |
|
bool |
registerToTransitionFiredEvents |
|
RequestScenarioFromServer(string)
Request the Scenario with the given instance Id from the server
Declaration
public void RequestScenarioFromServer(string scenarioInstanceId)
Parameters
Type |
Name |
Description |
string |
scenarioInstanceId |
|
RequestScenarioListFromServer(bool, bool)
Request the Scenario list from the server
Declaration
public void RequestScenarioListFromServer(bool includeExternalScenarios = false, bool includeFutureScenarios = false)
Parameters
Type |
Name |
Description |
bool |
includeExternalScenarios |
|
bool |
includeFutureScenarios |
|
RequestScenarioStateFromServer(string)
Request the State of Scenario with the given instance Id from the server
Declaration
public void RequestScenarioStateFromServer(string scenarioInstanceId)
Parameters
Type |
Name |
Description |
string |
scenarioInstanceId |
|
TryConnect(string, int)
Connect to the given server and start receiving data
Declaration
public void TryConnect(string hostAddress, int port = 7777)
Parameters
Type |
Name |
Description |
string |
hostAddress |
|
int |
port |
|
Events
OnConnectedEvent
Event when a connection occurs
Declaration
public event EventHandler OnConnectedEvent
Event Type
OnDisconnectedEvent
Event when a disconnection occurs
Declaration
public event EventHandler OnDisconnectedEvent
Event Type
OnReceivedScenarioEvent
Declaration
public event EventHandler<ScenarioLoadedEventArgs> OnReceivedScenarioEvent
Event Type
OnReceivedScenarioListEvent
Declaration
public event EventHandler<string[]> OnReceivedScenarioListEvent
Event Type
Implements