sugar-toolkit-gtk3/p2p/Service.py

32 lines
650 B
Python
Raw Normal View History

2006-05-12 03:56:23 +02:00
import presence
class Service(object):
2006-05-12 03:56:23 +02:00
def __init__(self, name, stype, address, port, multicast=False):
self._name = name
2006-05-12 03:56:23 +02:00
self._stype = stype
self._address = str(address)
self._port = int(port)
self._multicast = multicast
def get_name(self):
return self._name
2006-05-12 03:56:23 +02:00
def get_type(self):
return self._stype
def get_address(self):
return self._address
def get_port(self):
return self._port
def set_port(self, port):
self._port = port
def is_multicast(self):
return self._multicast
2006-05-12 03:56:23 +02:00
def register(self, group):
pannounce = presence.PresenceAnnounce()
pannounce.register_service(self._name, self._port, self._stype)