UnixListener

accept

defn

(Fn [(Ref UnixListener a)] (Result UnixStream String))

                        (accept listener)
                    

accepts a new Unix domain connection, returning a UnixStream. Blocks until a client connects. Returns (Result UnixStream String).

bind

defn

(Fn [(Ref String a)] (Result UnixListener String))

                        (bind path)
                    

binds a Unix domain socket listener to the given path. Unlinks any existing socket at that path first, then starts listening. Returns (Result UnixListener String).

close

external

(Fn [UnixListener] ())

closes the listener, releasing the file descriptor and unlinking the socket path.

copy

external

(Fn [(Ref UnixListener a)] UnixListener)

path

external

(Fn [(Ref UnixListener a)] String)

returns the path the listener is bound to.

poll-fd

defn

(Fn [(Ref UnixListener a)] Int)

                        (poll-fd l)
                    

while-accept

macro

Macro

                        (while-accept listener name :rest forms)
                    

accepts connections in a loop. Binds each accepted stream to name and executes forms, then closes the stream. Loops forever.