def doInit(self, arg): """ Action method. """ from transport.udp import udp_interface from transport.udp import udp_stream self.options = arg self.my_idurl = self.options['idurl'] self.listen_port = int(self.options['udp_port']) self.my_id = udp_interface.idurl_to_id(self.my_idurl) udp.proto(self.listen_port).add_callback(self._datagram_received) bandoutlimit = settings.getBandOutLimit() bandinlimit = settings.getBandInLimit() udp_stream.set_global_output_limit_bytes_per_sec(bandoutlimit) udp_stream.set_global_input_limit_bytes_per_sec(bandinlimit) reactor.callLater(0, udp_session.process_sessions) reactor.callLater(0, udp_stream.process_streams)
def doInit(self, arg): """ Action method. """ from transport.udp import udp_interface from transport.udp import udp_stream self.options = arg self.my_idurl = self.options['idurl'] self.listen_port = int(self.options['udp_port']) self.my_id = udp_interface.idurl_to_id(self.my_idurl) udp.proto(self.listen_port).add_callback(self._datagram_received) bandoutlimit = settings.getBandOutLimit() bandinlimit = settings.getBandInLimit() udp_stream.set_global_output_limit_bytes_per_sec(bandoutlimit) udp_stream.set_global_input_limit_bytes_per_sec(bandinlimit) reactor.callLater(0, udp_session.process_sessions) reactor.callLater(0, udp_stream.process_streams)
def _on_network_send_limit_modified(self, path, value, oldvalue, result): from transport.udp import udp_stream udp_stream.set_global_output_limit_bytes_per_sec(int(value))