Skip to content

A Tcl package for publishing and subscribing network services via Bonjour on OS X.

License

Notifications You must be signed in to change notification settings

lordmundi/tcl_bonjour

 
 

Repository files navigation

Overview

This package provides script level access to the Bonjour library. Bonjour allows registration of network services so that they can easily be located by name and/or browsed for by service type.

The bonjour package currently supports browsing for services, service name resolution, and service registration.

Installation

The bonjour package may be installed using the standard configure; make; make install procedure.

Commands

The bonjour package provides the following commands:

  • ::bonjour::browse start <regtype> <callback> – This procedue begins a browse operation for a given service type. Every time a service is added or removed to the list of running services, callback will be executed.
    • regtype – The service type to browse (i.e., _http._tcp)
    • callback – The command to call when a service is added or removed from the list of running services. Three arguments will be appended to the command:
      • the action (either add or remove)
      • the service name
      • the domain
  • ::bonjour::browse stop <regtype> – This procedure stops a browse operation. The callback registered for regtype will no longer be called and no new services will be aded.
    • regtype – The service type (i.e., _http._tcp)
  • ::bonjour::resolve <name> <regtype> <domain> <script> – This procedure resolves the given service name into a hostname and port.
    • name – The name of the service to resolve
    • regtype – The service type (i.e., _http._tcp)
    • domain – The domain for the service, as returned by the browse callback.
    • script – The script to execute when the resolution has completed. Four arguments will be appended to the callback script:
      • The full service name
      • The hostname
      • The port
      • a list of txt records for the service. The list of records will be of the form {key value ?key value? ...}.
  • ::bonjour::register <regtype> <port> ?txt-record? – This procedure registers a new service using Bonjour.
    • regtype – The service type (i.e., _http._tcp)
    • port – The port number for the service
    • txt-record – This argument is optional and specifies a list of txt record entries. The list should be of the form {key value ?key value? ...}.

Reporting Bugs and Requesting Features

Please report all bugs and feature requests via the GitHub issue tracker at http://github.com/dongola7/tcl_bonjour/issues.

About

A Tcl package for publishing and subscribing network services via Bonjour on OS X.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 96.4%
  • Tcl 3.6%