Liking cljdoc? Tell your friends :D

frereth.cp.server

Implement the server half of the CurveCP protocol

Implement the server half of the CurveCP protocol
raw docstring

build-event-loop-stopperclj

(build-event-loop-stopper {:keys [:frereth.cp.server.state/client-read-chan]
                           :as this})

check-packet-lengthclj

(check-packet-length log-state packet)

Could this packet possibly be a valid CurveCP packet, based on its size?

Could this packet possibly be a valid CurveCP packet, based on its size?
raw docstring

ctorclj

(ctor {:keys [:frereth.cp.server.state/max-active-clients]
       log-state :frereth.weald.specs/state
       :or {max-active-clients default-max-clients}
       :as cfg})

Just like in the Component lifecycle, this is about setting up a value that's ready to start

Just like in the Component lifecycle, this is about setting up a value that's ready to start
raw docstring

default-max-clientsclj


do-beginclj

(do-begin {:keys [:frereth.cp.server.state/client-read-chan]
           log-state :frereth.weald.specs/state
           :as this})

Start the event loop

Start the event loop
raw docstring

do-handle-incomingclj

(do-handle-incoming {log-state :frereth.weald.specs/state :as this}
                    {:keys [:host :port] message :message :as packet})

Packet arrived from client. Do something with it.

Packet arrived from client. Do something with it.
raw docstring

do-handle-messageclj

(do-handle-message state packet)

input-reducerclj

(input-reducer {:keys [:frereth.cp.server.state/client-read-chan
                       :frereth.weald.specs/logger]
                log-state :frereth.weald.specs/state
                :as this}
               msg)

Convert input into the next state

Convert input into the next state
raw docstring

minimum-message-packet-lengthclj


start!clj

(start! {:keys [:frereth.weald.specs/logger
                :frereth.cp.server.state/client-read-chan
                :frereth.cp.server.state/client-write-chan
                :frereth.cp.shared/extension :frereth.cp.shared/my-keys]
         log-state :frereth.weald.specs/state
         :as this})

Start a server

Start a server
raw docstring

stop!clj

(stop! {:keys [:frereth.weald.specs/logger
               :frereth.cp.server.state/event-loop-stopper!]
        log-state :frereth.weald.specs/state
        :as this})

Stop the ioloop (but not the read/write channels: we don't own them)

Stop the ioloop (but not the read/write channels: we don't own them)
raw docstring

verify-my-packetclj

(verify-my-packet {:keys [:frereth.cp.shared/extension]
                   log-state :frereth.weald.specs/state}
                  header
                  rcvd-xtn)

Was this packet really intended for this server?

Was this packet really intended for this server?
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close