Skip to content

fs socket

Turtle Kitty edited this page Jan 31, 2016 · 3 revisions

FS socket

An fs-socket is a unix socket living on the local filesystem. It is bidirectional, so supports the methods of both input and output ports.

Sockets come from three places: sys.fs.connect, the accept method of an fs-listener created by sys.fs.listen, or a call to sys.socket-pair.

listener messages

x.type -> 'fs-listener

x.to-bool -> true

x.path -> returns the file system path of the listener

x.ready? -> true if there is a connection ready to be accepted

x.accept -> accepts a connection and returns a socket

x.close -> shut down the listener

socket messages

x.read, x.read-rune, x.peek-rune, x.assert-rune, x.read-line, x.ready?, x.skip, x.skip-while, x.skip-until, x.read-token, x.read-token-while, x.read-token-until, x.read-token-if -> see stream

x.type -> 'socket

x.to-bool -> true

x.path -> file system path the socket is connected to

x.close -> close the socket

Clone this wiki locally