Callback for added ports.
499143
def _process_added_port_event(self, port_name):
        """"""
        LOG.info("Hyper-V VM vNIC added: %s", port_name)
        self._added_ports.add(port_name)
615475
def remove_port_callback(self, port, cb):
        """"""
        logger.debug('Removing callback on port [%d] to [%s]', port, cb)
        for port_callback in self.cb:
            if port_callback.port == port and port_callback.callback == cb:
                self.cb.remove(port_callback)
1149199
def create_port(self, port):
        """"""
        instance_type = self.get_instance_type(port)
        if not instance_type:
            return
        port_type = instance_type + a_const.PORT_SUFFIX
        p_res = MechResource(port['id'], port_type, a_const.CREATE)
        self.provision_queue.put(p_res)
1290843
def _call_callbacks(self):
        """"""
        for callback in self._callbacks:
            callback(self, self._changeset)
        self._changeset = {}
512640
def with_source_port_tag(self, tags, connected_value):
        """"""
        new_tags = [t for t in tags if not t.startswith("sourcePort:")]
        new_tags.append(self.source_port_tag(connected_value))
        return new_tags
476495
def update(self):
        

        self.states = [bool(int(x)) for x in self.get('port list') or '0000']
996020
function (port, parent_port) {

	// check if the port wasn't reported
	if (l_ports.hasOwnProperty(port) === false) {
		
		LOG.warn('recording used port [' + port + ']...', 'SR.Monitor');	
		l_ports[port] = parent_port || port;
	}
}
1343397
def _treat_devices_removed(self):
        """"""
        for device in self._removed_ports.copy():
            eventlet.spawn_n(self._process_removed_port, device)
513677
def allow_port(port, proto='tcp', direction='both'):
    '''
    
    '''

    ports = get_ports(proto=proto, direction=direction)
    direction = direction.upper()
    _validate_direction_and_proto(direction, proto)
    directions = build_directions(direction)
    results = []
    for direction in directions:
        _ports = ports[direction]
        _ports.append(port)
        results += allow_ports(_ports, proto=proto, direction=direction)
    return results
773180
def update_subports(self, port):
        
        trunk_details = port.get('trunk_details')
        subports = trunk_details['sub_ports']

        host_id = port.get(bc.dns.DNSNAME)
        context = bc.get_context()
        el_context = context.elevated()

        for subport in subports:
            bc.get_plugin().update_port(el_context, subport['port_id'],
                {'port':
                 {bc.portbindings.HOST_ID: host_id,
                  'device_owner': bc.trunk_consts.TRUNK_SUBPORT_OWNER}})

        # Set trunk to ACTIVE status.
        trunk_obj = bc.trunk_objects.Trunk.get_object(
            el_context, id=trunk_details['trunk_id'])
        trunk_obj.update(status=bc.trunk_consts.ACTIVE_STATUS)
1243479
def p_portlist(self, p):
        ''
        p[0] = Portlist(ports=p[2], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
191723
def _splpy_all_ports_ready(callable_):
    """"""
    if hasattr(type(callable_), 'all_ports_ready'):
        try:
            return callable_.all_ports_ready()
        except:
            ei = sys.exc_info()
            if streamsx._streams._runtime._call_exit(callable_, ei):
                return None
            raise e1[1]
    return None
467042
public void bind(ExposedPort exposedPort, Binding binding) {
        if (ports.containsKey(exposedPort)) {
            Binding[] bindings = ports.get(exposedPort);
            ports.put(exposedPort, (Binding[]) ArrayUtils.add(bindings, binding));
        } else {
            if (binding == null) {
                ports.put(exposedPort, null);
            } else {
                ports.put(exposedPort, new Binding[] {binding});
            }
        }
    }
1004534
def _port_scan(self, port):
        """"""
        if int(port['port']) == 0:
            return self._port_scan_icmp(port)
        else:
            return self._port_scan_tcp(port)
64503
public function registerPortEvents(): void
    {
        foreach ((array)$this->options['events'] as $event => $method) {
            // ['onConnect'] --> 'Connect', 'onConnect
            if (\is_int($event)) {
                $event = substr($method, 2);
            }

            // e.g $server->on('Request', [$this, 'onRequest']);
            if (method_exists($this, $method)) {
                $this->port->on($event, [$this, $method]);
            }
        }
    }
426448
def add_port_to_free_pool(self, port):
        """"""
        if port < 1 or port > 65535:
            raise ValueError(
                'Port must be in the [1, 65535] range, not %d.' % port)
        port_info = _PortInfo(port=port)
        self._port_queue.append(port_info)
1141801
def p_portlist_io(self, p):
        ''
        p[0] = Portlist(ports=p[2], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))