ssdp

package
v0.2.2-buildfails Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2015 License: BSD-2-Clause, MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SSDPRawSearch

func SSDPRawSearch(httpu *httpu.HTTPUClient, searchTarget string, maxWaitSeconds int, numSends int) ([]*http.Response, error)

SSDPRawSearch performs a fairly raw SSDP search request, and returns the unique response(s) that it receives. Each response has the requested searchTarget, a USN, and a valid location. maxWaitSeconds states how long to wait for responses in seconds, and must be a minimum of 1 (the implementation waits an additional 100ms for responses to arrive), 2 is a reasonable value for this. numSends is the number of requests to send - 3 is a reasonable value for this.

Types

type Entry

type Entry struct {
	// The address that the entry data was actually received from.
	RemoteAddr string
	// Unique Service Name. Identifies a unique instance of a device or service.
	USN string
	// Notfication Type. The type of device or service being announced.
	NT string
	// Server's self-identifying string.
	Server string
	Host   string
	// Location of the UPnP root device description.
	Location *url.URL

	BootID   int32
	ConfigID int32

	SearchPort uint16

	// When the last update was received for this entry identified by this USN.
	LastUpdate time.Time
	// When the last update's cached values are advised to expire.
	CacheExpiry time.Time
}

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry maintains knowledge of discovered devices and services.

func NewRegistry

func NewRegistry() *Registry

func (*Registry) ServeMessage

func (reg *Registry) ServeMessage(r *http.Request)

ServeMessage implements httpu.Handler, and uses SSDP NOTIFY requests to maintain the registry of devices and services.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL