coherence.upnp.core.ssdp (module)¶
SSDPServer
¶
Implementation of a SSDP server under Twisted and EventDispatcher.
-
class
SSDPServer
(test=False, interface='')[source]¶ Bases:
eventdispatcher.eventdispatcher.EventDispatcher
,twisted.internet.protocol.DatagramProtocol
,coherence.log.LogAble
A class implementing a SSDP server.
-
Changed in version 0.9.0:
Migrated from louie/dispatcher to EventDispatcher
The emitted events changed:
datagram_received => datagram_received
Coherence.UPnP.SSDP.new_device => new_device
Coherence.UPnP.SSDP.removed_device => removed_device
Coherence.UPnP.Log => log
Added new class variable root_devices which uses EventDispatcher’s properties
Note
The methods
notifyReceived()
andsearchReceived()
are called when the appropriate type of datagram is received by the server.-
logCategory
= 'ssdp'¶
-
root_devices
¶ A list of the detected root devices
-
shutdown
()[source]¶ Shutdowns the server
SSDPServer
and sends out the bye bye notifications via methoddoByebye()
.
-
register
(manifestation, usn, st, location, server='Linux, 4.15.0-1028-gcp, UPnP/1.0, Cohen3, 0.9.1', cache_control='max-age=1800', silent=False, host=None)[source]¶ Register a service or device that this SSDP server will respond to.
-
notifyReceived
(headers, xxx_todo_changeme1)[source]¶ Process a presence announcement. We just remember the details of the SSDP service announced.
-
discoveryRequest
(headers, xxx_todo_changeme2)[source]¶ Process a discovery request. The response must be sent to the address specified by (host, port).