Stop traffic on ports.

        :param ports: list of ports to stop traffic on, if empty start on all ports.
338994
def stop_transmit(self, *ports):
        

        port_list = self.set_ports_list(*ports)
        self.api.call_rc('ixStopTransmit {}'.format(port_list))
        time.sleep(0.2)
38165
def get_ports
      begin
        @port.get_ports
      rescue => ex
        Util.log_exception(ex, caller_locations(1, 1)[0].label)
        raise ex
      end
    end
473460
async def stop(self):
        """"""

        self._logger.info("Stopping all servers")
        for server in self.servers:
            await server.stop()

        self._logger.info("Stopping all device adapters")
        await self.device_manager.stop()
172553
def ports_mapping(self, ports):
        

        if ports != self._ports_mapping:
            if len(self._nios) > 0:
                raise NodeError("Can't modify a cloud already connected.")

            port_number = 0
            for port in ports:
                port["port_number"] = port_number
                port_number += 1

            self._ports_mapping = ports
1351809
def _parse_ports(port_values: dict) -> dict:
        
        # Initialising empty dictionary
        endpoints = {}

        for port_element in port_values:
            target_port = port_element.split(':')
            for port in target_port:
                endpoints[int(port)] = int(port)

        # Setting the types
        endpoint_spec = docker.types.EndpointSpec(ports=endpoints)
        return endpoint_spec
125899
def wait_transmit(self, *ports):
        

        port_list = self.set_ports_list(*ports)
        self.api.call_rc('ixCheckTransmitDone {}'.format(port_list))
1183320
def get_port_by_ref(self, port_ref):
        '''

        '''
        with self._mutex:
            for p in self.ports:
                if p.object._is_equivalent(port_ref):
                    return p
            return None
686645
def ensure_port_cleanup(bound_addresses, maxtries=30, sleeptime=2):
    
    atexit.register(_cleanup_ports, bound_addresses, maxtries=maxtries,
                    sleeptime=sleeptime)
90825
def stop(self, handle, reason=None):
        """"""
        params = self._get_params(reason=reason)
        self._transport.stop(handle, params)
238746
def stop_containers(self):
        
        while len(self._containers):
            container = self._containers.pop()
            try:
                container.kill(signal.SIGKILL)
            except docker.errors.APIError:  # probably doesn't exist anymore
                pass
596265
def set_ports(self, port0 = 0x00, port1 = 0x00):
        ''
        self.bus.write_byte_data(self.address, self.CONTROL_PORT0, port0)
        self.bus.write_byte_data(self.address, self.CONTROL_PORT0, port1)
        return
755349
def stop(self, container, **kwargs):
        
        self.push_log("Stopping container '{0}'.".format(container))
        super(DockerFabricClient, self).stop(container, **kwargs)
994126
def has_port_by_ref(self, port_ref):
        '''

        '''
        with self._mutex:
            if self.get_port_by_ref(self, port_ref):
                return True
            return False
1292386
def remove_trunk_ports(self):
        
        ports = self.attributes.get("{}Disable Full Trunk Ports".format(self.namespace_prefix), None)
        return self._parse_ports(ports=ports)
1243479
def p_portlist(self, p):
        ''
        p[0] = Portlist(ports=p[2], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
1180258
def pick_unused_ports(num_ports, retry_interval_secs=3, retry_attempts=5):
  """"""
  ports = set()
  for _ in range(retry_attempts):
    ports.update(
        portpicker.pick_unused_port() for _ in range(num_ports - len(ports)))
    ports.discard(None)  # portpicker returns None on error.
    if len(ports) == num_ports:
      return list(ports)
    # Duplicate ports can be returned, especially when insufficient ports are
    # free. Wait for more ports to be freed and retry.
    time.sleep(retry_interval_secs)

  # Could not obtain enough ports. Release what we do have.
  return_ports(ports)

  raise RuntimeError("Unable to obtain %d unused ports." % num_ports)
973827
def loop_stopped(self):
		
		transport = self.transport()
		if self.server_mode() is True:
			transport.close_server_socket(self.config())
		else:
			transport.close_client_socket(self.config())