![]() |
Roboid Control for C#
|
A site server is a participant which provides a shared simulated environment.
Public Member Functions | |
SiteServer (int port=7681) | |
Create a new site server. | |
void | Close () |
Close the site. | |
override void | Update (ulong currentTimeMS=0) |
Update all things for this participant. | |
void | SendThingInfo (Participant owner, Thing thing) |
void | PublishThingInfo (Thing thing) |
bool | Send (Participant owner, IMessage msg) |
bool | Publish (IMessage msg) |
void | ReceiveData (byte[] data, Participant sender) |
Thing | Get (byte thingId) |
Get the thing with the given properties. | |
void | Add (Thing thing, bool checkId=true) |
Add a new thing for this participant. | |
void | Remove (Thing thing) |
Remove a thing for this participant. | |
Static Public Member Functions | |
static ParticipantUDP | Isolated () |
Isolated participant is used when the application is run without networking. | |
static Participant | GetParticipant (string ipAddress, int port) |
Retrieve a participant using ip address and port number. | |
static Participant | GetParticipant (int networkId) |
Retrieve a participant using a network ID. | |
static Participant | AddParticipant (string ipAddress, int port) |
Add a new participant to the collection of participants. | |
static void | AddParticipant (Participant participant) |
Add a new participant to the collection of participants. | |
Public Attributes | |
string | name = "ParticipantUDP" |
The name of the participant. | |
bool | isIsolated = false |
True if the participant is running isolated. | |
Participant | remoteSite = null |
The remote site when this participant is connected to a site. | |
ulong | publishInterval = 3000 |
The interval in milliseconds for publishing (broadcasting) data on the local network. | |
byte[] | buffer = new byte[1024] |
IPEndPoint | endPoint = null |
UdpClient | udpClient = null |
string | broadcastIpAddress = "255.255.255.255" |
readonly ConcurrentQueue< IMessage > | messageQueue = new ConcurrentQueue<IMessage>() |
string | ipAddress = "0.0.0.0" |
The Ip Address of a participant. When the participant is local, this contains 0.0.0.0. | |
int | port = 0 |
The port number for UDP communication with the participant. This is 0 for isolated participants. | |
byte | networkId = 0 |
he network Id to identify the participant | |
readonly List< Thing > | things = new() |
The things managed by this participant. | |
Static Public Attributes | |
static readonly List< Participant > | participants = new() |
The collection of known participants. | |
Protected Member Functions | |
override void | UpdateMyThings (ulong currentTimeMS) |
override void | Process (Participant sender, ParticipantMsg msg) |
override void | Process (Participant sender, NetworkIdMsg msg) |
override void | Process (Participant sender, ThingMsg msg) |
void | GetBroadcastAddress (IPAddress ip, IPAddress subnetMask) |
virtual void | UpdateOtherThings (ulong currentTimeMS) |
void | ReceiveUDP (IAsyncResult result) |
virtual void | Process (Participant sender, InvestigateMsg msg) |
virtual void | Process (Participant sender, NameMsg msg) |
virtual void | Process (Participant sender, ModelUrlMsg msg) |
virtual void | Process (Participant sender, PoseMsg msg) |
virtual void | Process (Participant sender, BinaryMsg msg) |
virtual void | Process (Participant sender, TextMsg msg) |
virtual void | Process (Participant sender, DestroyMsg msg) |
Protected Attributes | |
ulong | nextPublishMe = 0 |
RoboidControl.SiteServer.SiteServer | ( | int | port = 7681 | ) |
Create a new site server.
port | The port of which to receive the messages |
|
protectedvirtual |
Reimplemented from RoboidControl.ParticipantUDP.
|
protectedvirtual |
Reimplemented from RoboidControl.ParticipantUDP.
|
protectedvirtual |
Reimplemented from RoboidControl.ParticipantUDP.
|
protectedvirtual |
Reimplemented from RoboidControl.ParticipantUDP.
|
staticinherited |
Isolated participant is used when the application is run without networking.
|
virtualinherited |
Update all things for this participant.
currentTimeMS | The current time in milliseconds (optional) |
Reimplemented from RoboidControl.Participant.
|
inherited |
Get the thing with the given properties.
thingId | The ID of the thing |
|
inherited |
Add a new thing for this participant.
thing | The thing to add |
checkId | If true, the thing.id is regenerated if it is zero |
|
inherited |
Remove a thing for this participant.
thing | The thing to remove |
|
staticinherited |
Retrieve a participant using ip address and port number.
ipAddress | The ip address of the participant |
port | The port number used to send messages to the participant |
|
staticinherited |
Retrieve a participant using a network ID.
networkId | The network ID of the participant |
|
staticinherited |
Add a new participant to the collection of participants.
ipAddress | The IP address of the participant |
port | The port used to send messages to this participant |
|
staticinherited |
Add a new participant to the collection of participants.
participant | The participant to add |
<note>This function only adds the participant if it is not yet in the collection</note>
|
inherited |
True if the participant is running isolated.
Isolated participants do not communicate with other participants