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})
source

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?
sourceraw 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
sourceraw docstring

default-max-clientsclj

source

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
sourceraw 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.
sourceraw docstring

do-handle-messageclj

(do-handle-message state packet)
source

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
sourceraw docstring

minimum-message-packet-lengthclj

source

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
sourceraw 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)
sourceraw 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?
sourceraw docstring

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

× close