sys::Obj sys::Virtual sys::Component sys::Service sox::SoxService
public class SoxService
SoxService implements the Dasp/Sox protocol for network provisioning, programming, and data access to a Sedona device.
public static const define int HOUSE_KEEPING_INTERVAL
public inline UdpDatagram datagram
public property short eventsPerSec [config]
Max of number of async events sent per second. Tuning this number down towards zero will decrease the number of messages sent, but increase the latency of real-time change propogation. If set all the way down to zero, then no change of value events are sent.
public inline BufInStream in
public bool isPortOpen
public short lastCompId
public long lastHouseKeeping
public static const define Log log
public short numEventsThisPeriod
public inline BufOutStream out
public inline Buf packet
public long periodEnd
public property short port [config, defaultOnClone]
UDP port for listening
public property byte receiveMax [config]
Max of number of messages in receiving window.
public inline SoxSession[] sessions
public inline UdpSocket socket
public UserService userService
public virtual override bool canHibernate()
Return true if this Service will allow hibernation. The SoxService should not allow hibernation if any SoxSessions are open.
public void dispatch()
Dispatch a received dasp/sox message.
public virtual override void execute()
Execute - called once per cycle.
public bool send(SoxSession s)
Send the packet over the network to the specified session. Return true on success, false on failure.
public SoxSession session(int sessionId)
Lookup the session by id, update the receive ticks and return it. If the session id is invalid or has been closed then return null.
public virtual override void start()
Start the SoxService:
- init datagram.buf to use packet.bytes - initWatches - initTransfers - open UDP port - lookup user service
public virtual override void stop()
Stop the SoxService.
public virtual override bool work()
Check for service work:
- check if we should retry port open - check for received packet - if received process it - check watches - check events