init commit

This commit is contained in:
2026-03-09 23:09:46 -04:00
parent 5cbc493cc5
commit 5da77e3360
73 changed files with 9935 additions and 103 deletions
+33
View File
@@ -0,0 +1,33 @@
(ns gen_udp
"Erlang :gen_udp module — UDP socket interface.
In CljElixir: (gen_udp/open port opts), (gen_udp/send socket addr port data), etc.")
(defn open
"Opens a UDP socket. Returns {:ok socket} or {:error reason}.
(gen_udp/open 0 [:binary {:active false}]) ;=> {:ok socket}"
([port])
([port opts]))
(defn send
"Sends a UDP packet.
(gen_udp/send socket \"localhost\" 4000 \"hello\")
(gen_udp/send socket destination packet)"
([socket destination packet])
([socket host port packet]))
(defn recv
"Receives a UDP packet. Returns {:ok {address port data}} or {:error reason}.
(gen_udp/recv socket 0) ;=> {:ok {addr port data}}
(gen_udp/recv socket 1024 5000) ;=> with timeout"
([socket length])
([socket length timeout]))
(defn close
"Closes a UDP socket.
(gen_udp/close socket) ;=> :ok"
[socket])
(defn controlling-process
"Transfers socket ownership to another process."
[socket pid])