- ext
- clib
- socket.pl -- Network socket (TCP and UDP) library
- uid.pl -- User and group management on Unix systems
- unix.pl -- Unix specific operations
- syslog.pl
- filesex.pl -- Extended operations on files
- uri.pl -- Process URIs
- process.pl -- Create processes and redirect I/O
- time.pl -- Time and alarm library
- sha.pl -- SHA secure hashes
- crypt.pl
- memfile.pl
- uuid.pl -- Universally Unique Identifier (UUID) Library
- hash_stream.pl -- Maintain a hash on a stream
- md5.pl -- MD5 hashes
- streampool.pl -- Input multiplexing
- cgi.pl -- Read CGI parameters
- prolog_stream.pl -- A stream with Prolog callbacks
- udp_broadcast.pl -- A UDP broadcast proxy
- rlimit.pl
- clib
- udp_unicast_join_hook(+Scope, +From, +Data) is semidet[multifile, library(udp_broadcast)]
- This multifile hook is called if an UDP package is received on the
port of the unicast network identified by Scope. From is the origin
IP and port and Data is the message data that is deserialized as
defined for the scope (see udp_term_string/3).
This hook is intended to initiate a new node joining the network of peers. We could in theory also omit the in-scope test and use a normal broadcast to join. Using a different channal however provides a basic level of security. A possibe implementation is below. The first fragment is a hook added to the server, the second is a predicate added to a client and the last initiates the request in the client. The excanged term (
join(X)
) can be used to exchange a welcome handshake.:- multifile udp_broadcast:udp_unicast_join_hook/3. udp_broadcast:udp_unicast_join_hook(Scope, From, join(welcome)) :- udp_peer_add(Scope, From),
join_request(Scope, Address, Reply) :- udp_peer_add(Scope, Address), broadcast_request(udp(Scope, join(X))).
?- join_request(myscope, "1.2.3.4":10001, Reply). Reply = welcome.