示例#1
0
    def __init__(self, host):
        Logr.configure(logging.DEBUG)

        self.host = host

        self.device = TmServerDevice(host)

        self.upnp = UPnP(self.device)
        self.ssdp = SSDP(self.device, [host], host)
示例#2
0
            except EOFError:
                self.command_stop()

    def command_stop(self):
        # Send 'byebye' NOTIFY
        self.ssdp.clients.sendall_NOTIFY(None, 'ssdp:byebye', True)

        # Stop everything
        self.upnp.stop()
        self.ssdp.stop()
        reactor.stop()
        self.running = False


if __name__ == '__main__':
    Logr.configure(logging.DEBUG)

    device = MediaServerDevice()

    upnp = UPnP(device)
    ssdp = SSDP(device)

    upnp.listen()
    ssdp.listen()

    def event_test():
        #        device.contentDirectory.system_update_id = time.time()
        reactor.callLater(5, event_test)

    event_test()
示例#3
0
文件: main.py 项目: AchillesA/PyUPnP
                    getattr(self, command)()
            except EOFError:
                self.command_stop()

    def command_stop(self):
        # Send 'byebye' NOTIFY
        self.ssdp.clients.sendall_NOTIFY(None, 'ssdp:byebye', True)

        # Stop everything
        self.upnp.stop()
        self.ssdp.stop()
        reactor.stop()
        self.running = False

if __name__ == '__main__':
    Logr.configure(logging.DEBUG)

    device = MediaServerDevice()

    upnp = UPnP(device)
    ssdp = SSDP(device)

    upnp.listen()
    ssdp.listen()

    def event_test():
        device.contentDirectory.system_update_id = time.time()
        reactor.callLater(5, event_test)

    event_test()