Ejemplo n.º 1
0
	def bind(self):
		AuthenticatedTransport.bind(self)
		self._adapter.SetProperty('Discoverable', self._address is None, signature='sv')
		self._serverSocket = bluetooth.BluetoothSocket(bluetooth.RFCOMM)
		self._serverSocket.bind(('', bluetooth.PORT_ANY))
		self._serverSocket.listen(self['socketConnectionBacklog'])
		bluetooth.advertise_service(self._serverSocket, 'kozo', service_id=self._uuid, service_classes=[self._uuid, bluetooth.SERIAL_PORT_CLASS], profiles=[bluetooth.SERIAL_PORT_PROFILE])
		infoTransport(self, 'Bound on port', self._serverSocket.getsockname()[1], 'with UUID', self._uuid)
Ejemplo n.º 2
0
	def bind(self):
		AuthenticatedTransport.bind(self)
		self._serverSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
		self._serverSocket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
		self._serverSocket.bind((self['bindAddress'], self['port']))
		self._serverSocket.listen(self['socketConnectionBacklog'])