Sedona

sox::SoxService


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.


HOUSE_KEEPING_INTERVAL

public static const define int HOUSE_KEEPING_INTERVAL

datagram

public inline UdpDatagram datagram

eventsPerSec

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.

in

public inline BufInStream in

isPortOpen

public bool isPortOpen

lastCompId

public short lastCompId

lastHouseKeeping

public long lastHouseKeeping

log

public static const define Log log

numEventsThisPeriod

public short numEventsThisPeriod

out

public inline BufOutStream out

packet

public inline Buf packet

periodEnd

public long periodEnd

port

public property short port [config, defaultOnClone]

UDP port for listening

receiveMax

public property byte receiveMax [config]

Max of number of messages in receiving window.

sessions

public inline SoxSession[] sessions

socket

public inline UdpSocket socket

userService

public UserService userService

canHibernate

public virtual override bool canHibernate()

Return true if this Service will allow hibernation. The SoxService should not allow hibernation if any SoxSessions are open.

dispatch

public void dispatch()

Dispatch a received dasp/sox message.

execute

public virtual override void execute()

Execute - called once per cycle.

send

public bool send(SoxSession s)

Send the packet over the network to the specified session. Return true on success, false on failure.

session

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.

start

public virtual override void start()

Start the SoxService:

 - init datagram.buf to use packet.bytes
 - initWatches
 - initTransfers
 - open UDP port
 - lookup user service
stop

public virtual override void stop()

Stop the SoxService.

work

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