aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--elymas/lib/net/dns.ey11
-rw-r--r--elymas/lib/net/udp.ey5
2 files changed, 11 insertions, 5 deletions
diff --git a/elymas/lib/net/dns.ey b/elymas/lib/net/dns.ey
index 11ea73d..28efc2d 100644
--- a/elymas/lib/net/dns.ey
+++ b/elymas/lib/net/dns.ey
@@ -2,6 +2,9 @@
# Spec: http://www.faqs.org/rfcs/rfc1035.html
<
+ { ==err _ 0 lt { err ?? } rep } "+??" deffd
+ { ==err ==actions _ 0 lt { actions err ??? } rep } "+???" deffd
+
# Uncomment to enable function ("deffd") tracing for this scope
# {
# -010 { " executing" cat dump }_ -01 ; -01 =*:
@@ -23,20 +26,20 @@
{ ==host
ensureResolvConf
resolvConf .nameserver parseIpv4 53 net .udp .sockaddrIpv4
- +AFINET +SOCKDGRAM +IPPROTOUDP +socket _ ==s # TODO: error handling
- -01 +connect -- # TODO: error handling
+ +AFINET +SOCKDGRAM +IPPROTOUDP +socket +??io.net.socket _ ==s
+ -01 +connect +??io.net.connect --
s
host buildDnsQueryMessage
_ len
- +write -- # TODO: error handling
+ +write +??io.net.write -- # TODO: correctly handle non-full writes
1024 str .alloc ==buf
s
buf
_ len
- +read # TODO: error handling
+ +read +??io.net.read
buf str .inplacePrefix =buf
buf
diff --git a/elymas/lib/net/udp.ey b/elymas/lib/net/udp.ey
index 5260d5c..757ba07 100644
--- a/elymas/lib/net/udp.ey
+++ b/elymas/lib/net/udp.ey
@@ -1,6 +1,9 @@
# Provide nice ways to do TCP/IP networking
<
+ { ==err _ 0 lt { err ?? } rep } "+??" deffd
+ { ==err ==actions _ 0 lt { actions err ??? } rep } "+???" deffd
+
bin .scan "->" via
bin .print "<-" via
bin .produce "<=" via
@@ -23,7 +26,7 @@
-01 txt .consume .u16
sockaddrIpv4
+socket _ ==s
- -01 +connect -- # TODO: error handling
+ -01 +connect +??io.net.connect --
} /connectFd deffd
# 0 -> "host:port"