sugar-toolkit-gtk3/p2p/Service.py
2006-05-11 22:31:02 -04:00

32 lines
650 B
Python

import presence
class Service(object):
def __init__(self, name, stype, address, port, multicast=False):
self._name = name
self._stype = stype
self._address = str(address)
self._port = int(port)
self._multicast = multicast
def get_name(self):
return self._name
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
def register(self, group):
pannounce = presence.PresenceAnnounce()
pannounce.register_service(self._name, self._port, self._stype)