Roboid Control for C#
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Passer.RoboidControl.SiteServer Class Reference

Detailed Description

A site server is a participant which provides a shared simulated environment.

Inheritance diagram for Passer.RoboidControl.SiteServer:
Passer.RoboidControl.Participant Passer.RoboidControl.RemoteParticipant

Public Member Functions

 SiteServer (int port=7681)
 Create a new site server.
 
void Close ()
 Close the site.
 
override void Publish ()
 
RemoteParticipant GetParticipant (string ipAddress, int port)
 
RemoteParticipant AddParticipant (string ipAddress, int port)
 
delegate Thing ThingConstructor (byte networkId, byte thingId)
 
void Register (byte thingType, ThingConstructor constr)
 
void Register< ThingClass > (Thing.Type thingType)
 
void Register< ThingClass > (byte thingType)
 
virtual void Update (ulong currentTimeMS=0)
 
bool Publish (IMessage msg)
 
void SendThingInfo (RemoteParticipant remoteParticipant, Thing thing)
 
bool Send (IMessage msg)
 
bool Send (RemoteParticipant remoteParticipant, IMessage msg)
 
void PublishThingInfo (Thing thing)
 
bool SendBuffer (int bufferSize)
 
bool PublishBuffer (int bufferSize)
 
void ReceiveData (byte[] data, RemoteParticipant remoteParticipant)
 
Thing Get (byte networkId, byte thingId)
 Get a thing with the given ids.
 
void Add (Thing thing, bool invokeEvent=true)
 Add a new thing for this participant.
 

Public Attributes

byte[] buffer = new byte[1024]
 
ulong publishInterval = 3000
 
string name = "Participant"
 
IPEndPoint endPoint = null
 
UdpClient udpClient = null
 
string broadcastIpAddress = "255.255.255.255"
 
readonly ConcurrentQueue< IMessagemessageQueue = new ConcurrentQueue<IMessage>()
 
List< RemoteParticipantsenders = new List<RemoteParticipant>()
 
string ipAddress = "0.0.0.0"
 The internet address of the participant.
 
int port = 0
 The UDP port on which the participant can be reached.
 
byte networkId
 The network ID of the participant.
 

Protected Member Functions

override void Process (RemoteParticipant sender, ParticipantMsg msg)
 
override void Process (RemoteParticipant sender, NetworkIdMsg msg)
 
override void Process (RemoteParticipant sender, ThingMsg msg)
 
void ReceiveUDP (IAsyncResult result)
 
virtual void Process (InvestigateMsg msg)
 
virtual void Process (RemoteParticipant sender, NameMsg msg)
 
virtual void Process (RemoteParticipant sender, ModelUrlMsg msg)
 
virtual void Process (PoseMsg msg)
 
virtual void Process (RemoteParticipant sender, BinaryMsg msg)
 
virtual void Process (TextMsg temsgxt)
 
virtual void Process (DestroyMsg msg)
 

Protected Attributes

readonly Dictionary< byte, Func< byte, byte, Thing > > thingMsgProcessors = new Dictionary<byte, Func<byte, byte, Thing>>()
 
ulong nextPublishMe = 0
 
readonly List< Thingthings = new List<Thing>()
 The things reported by this participant.
 

Constructor & Destructor Documentation

◆ SiteServer()

Passer.RoboidControl.SiteServer.SiteServer ( int  port = 7681)

Create a new site server.

Parameters
port

Member Function Documentation

◆ Publish()

override void Passer.RoboidControl.SiteServer.Publish ( )
virtual

Reimplemented from Passer.RoboidControl.Participant.

◆ Process() [1/3]

override void Passer.RoboidControl.SiteServer.Process ( RemoteParticipant  sender,
ParticipantMsg  msg 
)
protectedvirtual

Reimplemented from Passer.RoboidControl.Participant.

◆ Process() [2/3]

override void Passer.RoboidControl.SiteServer.Process ( RemoteParticipant  sender,
NetworkIdMsg  msg 
)
protectedvirtual

Reimplemented from Passer.RoboidControl.Participant.

◆ Process() [3/3]

override void Passer.RoboidControl.SiteServer.Process ( RemoteParticipant  sender,
ThingMsg  msg 
)
protectedvirtual

Reimplemented from Passer.RoboidControl.Participant.

◆ Register< ThingClass >() [1/2]

void Passer.RoboidControl.Participant.Register< ThingClass > ( Thing::Type  thingType)
inherited
Type Constraints
ThingClass :Thing 

◆ Register< ThingClass >() [2/2]

void Passer.RoboidControl.Participant.Register< ThingClass > ( byte  thingType)
inherited
Type Constraints
ThingClass :Thing 

◆ Get()

Thing Passer.RoboidControl.RemoteParticipant.Get ( byte  networkId,
byte  thingId 
)
inherited

Get a thing with the given ids.

Parameters
networkIdThe networkId of the thing
thingIdThe ID of the thing
Returns
The thing when it is found, null in other cases.

◆ Add()

void Passer.RoboidControl.RemoteParticipant.Add ( Thing  thing,
bool  invokeEvent = true 
)
inherited

Add a new thing for this participant.

Parameters
thingThe thing to add
invokeEventInvoke an notification event when the thing has been added