Handle the inherently stateful pieces associated with the client side of things.
The fact that this is so big says a lot about needing to re-think my approach
Handle the inherently stateful pieces associated with the client side of things. The fact that this is so big says a lot about needing to re-think my approach
(->message-exchange-mode {:keys [:frereth.cp.client.state/chan<-server
:frereth.cp.client.state/chan->server
:frereth.cp.message.specs/->child]
log-state :frereth.weald.specs/state
:as this}
initial-server-response)
Just received first real response Message packet from the handshake. Now we can start doing something interesting.
Just received first real response Message packet from the handshake. Now we can start doing something interesting.
(child-> {log-state :frereth.weald.specs/state
:keys [:frereth.cp.client.state/chan->server
:frereth.weald.specs/logger
:frereth.cp.client.state/packet-builder
:frereth.cp.client.state/server-security]
:as state}
timeout
message-block)
Handle packets streaming out of child
Handle packets streaming out of child
(clientextension-init
{:keys [:frereth.cp.client.state/client-extension-load-time
:frereth.weald.specs/logger :frereth.cp.message.specs/recent
:frereth.cp.shared/extension]
log-state :frereth.weald.specs/state
:as this})
Initialize the client-extension
Initialize the client-extension
(current-timeout this)
How long should next step wait before giving up?
How long should next step wait before giving up?
(do-send-packet
{log-state :frereth.weald.specs/state
{:keys [:frereth.cp.shared.specs/srvr-ip :frereth.cp.shared.specs/srvr-port]
:as server-security}
:frereth.cp.client.state/server-security
:keys [:frereth.cp.client.state/chan->server :frereth.weald.specs/logger]
:as this}
on-success
on-failure
timeout
timeout-key
packet)
Send a ByteBuf (et al) as UDP to the server
With lots of bells, whistles, and callbacks
Send a ByteBuf (et al) as UDP to the server With lots of bells, whistles, and callbacks
(do-stop {child-state :frereth.cp.shared.child/state
log-state :frereth.weald.specs/state
:as this})
(extract-child-send-state state)
Extract the pieces that are actually used to forward a message from the Child
Extract the pieces that are actually used to forward a message from the Child
(final-wait this sent)
We've received the cookie and responded with a vouch. Now waiting for the server's first real message packet so we can switch into the message exchange loop
We've received the cookie and responded with a vouch. Now waiting for the server's first real message packet so we can switch into the message exchange loop
(fork! {:keys [:frereth.weald.specs/logger :frereth.cp.message.specs/->child
:frereth.cp.message.specs/child-spawner!
:frereth.cp.message.specs/message-loop-name]
log-state :frereth.weald.specs/state
:as this})
Create a new Child to do all the interesting work.
Create a new Child to do all the interesting work.
(initialize-immutable-values
{:keys [:frereth.cp.message.specs/message-loop-name
:frereth.cp.client.state/chan<-server
:frereth.cp.client.state/server-extension
:frereth.cp.client.state/server-ips :frereth.cp.shared.specs/executor]
log-state :frereth.weald.specs/state
:or {executor (exec/utilization-executor cpu-utilization-target)}
:as this}
log-initializer)
Sets up the immutable value that will be used in tandem with the mutable state later
Sets up the immutable value that will be used in tandem with the mutable state later
(initialize-mutable-state! {:keys [:frereth.cp.shared/my-keys
:frereth.cp.client.state/server-security
:frereth.weald.specs/logger
:frereth.cp.message.specs/message-loop-name]
:as this}
packet-builder)
(load-keys log-state my-keys)
(put-packet chan->server srvr-ip packet srvr-port timeout timeout-key)
Build and put a packet onto channel toward server
No bells, whistles, or anything else to make it fancier than needed
Build and put a packet onto channel toward server No bells, whistles, or anything else to make it fancier than needed
(update-client-short-term-nonce nonce)
Note that this can loop right back to a negative number.
Note that this can loop right back to a negative number.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close