Author(s): Francisco Bueno.
Version: 1.11#222 (2004/5/24, 13:8:7 CEST)
Version of last change: 1.11#117 (2003/12/22, 18:58:12 CET)
This module provides two useful predicates for programming with sockets.
sockets_io
)sockets_io
)
Meta-predicate with arguments: serve_socket(?,pred(1),pred(1))
.
Usage: serve_socket(Socket, Server, Handler)
Socket
calling Server
on one request of each stream (as Server(Stream)
), and Handler(Stream)
if the stream is empty (connection closed).
Socket
is a socket id.
(sockets_io:socket/1
)
Server
is a term which represents a goal, i.e., an atom or a structure.
(basic_props:callable/1
)
Handler
is a term which represents a goal, i.e., an atom or a structure.
(basic_props:callable/1
)
Usage: safe_write(Stream, Term)
Term
to Stream
in a way that it is safe for a socket connection on Stream
.
Stream
is an open stream.
(streams_basic:stream/1
)
Term
is any term.
(basic_props:term/1
)
Go to the first, previous, next, last section, table of contents.