2.1 library(tipc/tipc): TIPC Sockets
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
    • Packages
      • Transparent Inter-Process Communications (TIPC) libraries
        • The TIPC libraries: library(tipc/...)
          • library(tipc/tipc): TIPC Sockets
            • tipc_socket/2
            • tipc_close_socket/1
            • tipc_open_socket/3
            • tipc_bind/3
            • tipc_listen/2
            • tipc_accept/3
            • tipc_connect/2
            • tipc_get_name/2
            • tipc_get_peer_name/2
            • tipc_setopt/2
            • tipc_receive/4
            • tipc_send/4
            • tipc_canonical_address/2
            • tipc_service_exists/2
            • tipc_service_exists/1
            • tipc_service_probe/1
            • tipc_service_probe/2
            • tipc_service_port_monitor/2
            • tipc_service_port_monitor/3
            • tipc_initialize/0
Availability::- use_module(library(tipc/tipc)).
[det]tipc_service_port_monitor(+Addresses, :Goal)
[det]tipc_service_port_monitor(+Addresses, :Goal, ?Timeout)
Monitors a collection of worker threads that are bound to a list of Addresses. A single port monitor may be used to provide surveillance over workers that are providing a number of different services. For a given address type, discontiguous port ranges may be specified, but overlapping port ranges may not. Goal for example, may simply choose to broadcast the notification, thus delegating the notification event handling to others.
Addresses is a list of name/3 or name_seq/3 addresses for the services to be monitored.
Goal is a predicate that will be called when a worker's publication status changes. The Goal is called exactly once per event with its the last argument unified with the structure:
published(-NameSeq, -PortId)
when the worker binds its socket to the address.
withdrawn(-NameSeq, -PortId)
when the worker unbinds its socket from the address.

Timeout is optional. It is one of:
Timeout
a non-negative real number that specifies the number of seconds that surveillance is to be continued.
infinite
causes the monitor to run forever in the current thread (e.g. never returns).
detached(-ThreadId)
causes the monitor to run forever as a separate thread. ThreadId is unified with the thread identifier of the monitor thread. This is useful when the monitor is required to provide continuous surveillance, while operating in the background.