Handbook
Glossary
drain ( port handle -- event/f )
Vocabulary
io
.
files
Inputs
port
an
object
handle
an
object
Outputs
event/f
an
object
Definition
IN:
io.files
GENERIC:
drain
( port handle -- event/f )
Methods
USING:
accessors
classes
combinators
io.backend.unix
io.buffers
io.files
io.ports
kernel
kernel.private
libc
math
unix.ffi
;
M:
fd
drain
[
buffered-port
check-instance
buffer>>
]
[
fd>>
]
bi*
over
[
buffer@
]
[
buffer-length
]
bi
write
{
fixnum
}
declare
dup
0
>=
[
over
buffer-consume
buffer-empty?
f
+output+
?
]
[
errno
{
{
EINTR
[
2drop
+retry+
]
}
{
EAGAIN
[
2drop
+output+
]
}
{
ENOBUFS
[
2drop
+output+
]
}
[
(throw-errno)
]
}
case
]
if
;
USING:
accessors
io.files
io.sockets.secure.openssl
kernel
;
M:
ssl-handle
drain
throw-if-terminated
[
buffer>>
]
[
maybe-handshake
]
bi*
do-ssl-write
;