Skip to main content

Module pvws

Module pvws 

Source
Expand description

A PV Web Socket server in the dialect of https://github.com/ornl-epics/pvws.

Clients send subscribe, clear, write, list and echo messages and get one update per changed PV: full metadata first, then only what changed. Like PVWS, an update with neither value nor text means the PV is not connected.

StructsΒ§

Changed πŸ”’
The PVs that changed since a client last heard, and a wake-up for it.
ClientSlot πŸ”’
Counts a connected client until dropped.
Config
Hub
What every client connection shares.
Pace πŸ”’
Paces a client’s new subscriptions: each spends a token, and tokens come back at SUBSCRIBE_RATE a second up to SUBSCRIBE_BURST.
Sub πŸ”’
SubSlot πŸ”’
Subs πŸ”’
One client’s subscriptions.

ConstantsΒ§

MAX_CLIENTS πŸ”’
The most clients connected at once.
MAX_MESSAGE πŸ”’
The largest message a client may send.
MAX_NAME πŸ”’
The longest PV name accepted.
MAX_PVS πŸ”’
The most PVs one client may subscribe to.
MAX_TOTAL_PVS πŸ”’
The most PVs all clients together may subscribe to.
SEND_TIMEOUT πŸ”’
The longest one message to a client may take to send before the client is dropped.
SUBSCRIBE_BURST πŸ”’
New PVs one client may subscribe to at once …
SUBSCRIBE_RATE πŸ”’
… and each second after that: more are delayed, not refused.

FunctionsΒ§

browser_allowed πŸ”’
Whether a request comes from a page of this server or an allowed origin, by a name of this server; a request without an Origin is not from a browser page.
client_key πŸ”’
The address clients are counted by: an IPv4 address (also when mapped into IPv6), or the /64 network of an IPv6 one, as one machine may hold all of a /64.
encode_value πŸ”’
error πŸ”’
fits_i32 πŸ”’
handle πŸ”’
Act on one client message, returning any replies.
host_allowed πŸ”’
Whether browsers may call this server host (lowercase, no port).
host_name πŸ”’
The host of a host[:port], keeping the brackets of an IPv6 address.
info
machine_names πŸ”’
This machine’s names: as the kernel and /etc/hostname have them, each without its domain, and in each domain of /etc/resolv.conf.
names_of πŸ”’
Every name of a machine called hostnames in domains: exact names only, so ws01.evil.com is not ws01.site.org.
new_names πŸ”’
How many PVs a message subscribes to that the client does not have.
normalise_origin πŸ”’
An origin in one spelling: lowercase, no trailing /, no default port.
number πŸ”’
A double as PVWS sends it: non-finite values as text.
resolv_domains πŸ”’
The domains of a resolv.conf: its domain and search lines.
same_range πŸ”’
Whether two limit pairs are equal, with NaN equal to NaN (unset alarm limits are NaN, which would otherwise be sent on every update).
same_value πŸ”’
Whether two values are equal, without comparing arrays that are the same allocation element by element, and with NaN equal to NaN.
send πŸ”’
Send one message, giving up on a client that takes too long to take it.
send_all πŸ”’
send_updates πŸ”’
Tell the client about every PV that changed since it last heard.
serve πŸ”’
served_scheme πŸ”’
Whether a client may have name from this server: not loc:// PVs, which would live here for ever and be shared by every client, nor sim:// ones, which cost the server for nothing, nor formulas, which could read the server’s loc:// PVs. A page makes all three itself.
severity πŸ”’
socket
strip_default_port πŸ”’
token_ok πŸ”’
Whether given is the write token, without stopping at the first difference.
update πŸ”’
The update message taking a client from last to s, if anything it would see changed.
updates πŸ”’
The updates for the PVs that changed since the client last heard.
valid_name πŸ”’
Whether name is a plausible PV name: not too long, and only printable ASCII with no spaces.
vtype πŸ”’
write_error πŸ”’
An error naming the PV a write was refused for, so the page can show it by the PV as well as log it.
write_text πŸ”’
A written value as the text Pv::write takes; whole numbers lose their .0 so integer PVs accept them.