19.1 Caveats
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
    • Packages
      • SWI-Prolog C-library
        • library(udp_broadcast): A UDP broadcast proxy
          • Caveats
            • udp_broadcast_close/1
            • udp_broadcast_initialize/2
            • udp_peer_add/2
            • udp_peer_del/2
            • udp_peer/2
            • udp_term_string_hook/3
            • udp_unicast_join_hook/3
Availability::- use_module(library(udp_broadcast)).
Source[det,multifile]udp_term_string_hook(+Scope, +Term, -String)
[semidet,multifile]udp_term_string_hook(+Scope, -Term, +String)
Hook for serializing the message Term. The default writes %prolog\n, followed by the Prolog term in quoted notation while ignoring operators. This hook may use alternative serialization such as fast_term_serialized/2, use library(ssl) to realise encrypted messages, etc.
Scope is the scope for which the message is broadcasted. This can be used to use different serialization for different scopes.
Term encapsulates the term broadcasted by the application as follows:
send(ApplTerm)
Is sent by broadcast(udp(Scope, ApplTerm))
request(Id, ApplTerm)
Is sent by broadcast_request/1, where Id is a unique large (64 bit) integer.
reply(Id, ApplTerm)
Is sent to reply on a broadcast_request/1 request that has been received. Arguments are the same as above.

throws
The hook may throw udp(invalid_message) to stop processing the message.