Author(s): Francisco Bueno.
Version: 1.10#7 (2006/4/26, 19:22:13 CEST)
Version of last change: 1.9#241 (2003/12/22, 18:56:7 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.