aboutsummaryrefslogtreecommitdiff
path: root/src/algebra
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2008-10-25 03:21:55 +0000
committerdos-reis <gdr@axiomatics.org>2008-10-25 03:21:55 +0000
commita3dccc344e57259f113b7f2d7e2761ad8131e60b (patch)
tree6cd6ea55fdfa2470c08355321af49cd650ca5963 /src/algebra
parentca39f5ae7631e3bedf6114f7ebe7dfa2a8579f76 (diff)
downloadopen-axiom-a3dccc344e57259f113b7f2d7e2761ad8131e60b.tar.gz
* interp/sys-os.boot: Import oa_socket_read_byte as
readByteFromStreamSocket. Import oa_socket_write_byte as writeByteToStreamSocket. * include/sockio.h (oa_socket_read_byte): Declare. (oa_socket_write_byte): Likewise. * lib/sockio-c.c (oa_socket_read_byte): Define. (oa_socket_write_byte): Likewise. * algebra/net.spad.pamphlet (readByteIfCan!$InetClientStreamSocket): Implement. (writeByteIfCan!$InetClientStreamSocket): Likewise. * etc/asq.c.pamphlet: Update build rules for asq$(EXEEXT).
Diffstat (limited to 'src/algebra')
-rw-r--r--src/algebra/net.spad.pamphlet9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/algebra/net.spad.pamphlet b/src/algebra/net.spad.pamphlet
index a216a5fb..f73b278c 100644
--- a/src/algebra/net.spad.pamphlet
+++ b/src/algebra/net.spad.pamphlet
@@ -361,6 +361,10 @@ InetClientStreamSocket(): Public == Private where
if n <= 0 then close! x
else setLength!(b,n : NonNegativeInteger)
n
+ readByteIfCan! x ==
+ r: SingleInteger := readByteFromStreamSocket(rep(x).%sock)$Lisp
+ if r < 0 then close! x
+ r
writeBytes!(x,b) ==
n: SingleInteger :=
@@ -369,6 +373,11 @@ InetClientStreamSocket(): Public == Private where
else setLength!(b,n : NonNegativeInteger)
n
+ writeByteIfCan!(x,b) ==
+ r: SingleInteger := writeByteToStreamSocket(rep(x).%sock,b)$Lisp
+ if r < 0 then close! x
+ r
+
close! x ==
closeSocket(rep(x).%sock)$Lisp
rep(x).%sock := -1::SingleInteger