The actual service to which the user has connected.
338690
def handle(self):
        ""
        if not self.authentication_ok():
            return
        if self.DOECHO:
            self.writeline(self.WELCOME)
        self.session_start()
        while self.RUNSHELL:
            read_line = self.readline(prompt=self.PROMPT).strip('\r\n')
            if read_line:
                self.session.transcript_incoming(read_line)
            self.input = self.input_reader(self, read_line)
            self.raw_input = self.input.raw
            if self.input.cmd:
                # TODO: Command should not be converted to upper
                # looks funny in error messages.
                cmd = self.input.cmd.upper()
                params = self.input.params
                if cmd in self.COMMANDS:
                    try:
                        self.COMMANDS[cmd](params)
                    except:
                        logger.exception('Error calling {0}.'.format(cmd))
                        (t, p, tb) = sys.exc_info()
                        if self.handleException(t, p, tb):
                            break
                else:
                    self.writeline('-bash: {0}: command not found'.format(cmd))
                    logger.error("Unknown command '{0}'".format(cmd))
        logger.debug("Exiting handler")
1068456
def verify_state(self):
        
        if self.state == SESSION_STATE.CONNECTING:
            self.state = SESSION_STATE.OPEN

            self.conn.connectionMade(self.conn_info)
191134
def _connected(self, link_uri):
        
        print('Connected to %s' % link_uri)

        self._cf.packet_received.add_callback(self._got_packet)
785553
def connection_made(self):
        
        assert self.state == BGP_FSM_CONNECT
        # We have a connection with peer we send open message.
        open_msg = self._peer.create_open_msg()
        self._holdtime = open_msg.hold_time
        self.state = BGP_FSM_OPEN_SENT
        if not self.is_reactive:
            self._peer.state.bgp_state = self.state
        self.sent_open_msg = open_msg
        self.send(open_msg)
        self._peer.connection_made()
747178
def after_connect(self):
        """"""
        # TODO: check if this works.
        show_users = self.device.send("show users", timeout=120)
        result = re.search(pattern_manager.pattern(self.platform, 'connected_locally'), show_users)
        if result:
            self.log('Locally connected to Calvados. Exiting.')
            self.device.send('exit')
            return True
        return False
156173
public ServiceStatus getServiceStatus() {
        boolean canSendProbeRequest = !isHardTrip && lastFailure.get() > 0
            && allowRequest();

        if (byPass) {
            return new ServiceStatus(name, Status.DEGRADED, "Bypassed");
        }

        switch(state) {
            case OPEN:
                return (canSendProbeRequest ?
                        new ServiceStatus(name, Status.DEGRADED, "Send Probe Request")
                        : new ServiceStatus(name, Status.DOWN, "Open"));
            case HALF_CLOSED: return new ServiceStatus(name, Status.DEGRADED, "Half Closed");
            case CLOSED:
            default:
                return new ServiceStatus(name, Status.UP);
        }
    }
863975
def _connect(self):
        
        self.conn = self._create_connection()
        spawn(self.conn.connect)
        self.set_nick(self.nick)
        self.cmd(u'USER', u'{0} 3 * {1}'.format(self.nick, self.realname))
303886
function() {
		    //io = socket(process.env.PORT || process.env.NODE_PORT || 3333);
        io = socket(http);

		    io.on('connection', function(socket){
            console.log('connection happened');
			      //Logic for handeling a new connection here.
			      //ie. registering a user or something similar.

			      //The new connection can send commands.
			      socket.on('keydown', function(data) {
				        var index = keysToPress.indexOf(data.key);
				        if(index === -1) {
					          keysToPress.push(data.key);
				        }
			      });

			      socket.on('keyup', function(data) {
				        var index = keysToPress.indexOf(data.key);
				        if(index !== -1) {
					          keysToPress.splice(index, 1);
				        }
			      });

			      socket.on('restart', function(data) {
				        gameboy_instance.loadROM(rom);
			      });

		    });
	  }
197996
def connection_made(self, transport):
        '''
        
        '''

        self._connected = True
        self.transport = transport

        self.remote_ip, self.port = transport.get_extra_info('peername')[:2]

        logging.debug(
            'Connection made (address: {} port: {})'
            .format(self.remote_ip, self.port))

        self.auth_future = self.send_package(protomap.CPROTO_REQ_AUTH,
                                             data=(self._username,
                                                   self._password,
                                                   self._dbname),
                                             timeout=10)

        self._password = None
        self.on_connection_made()
624188
def connectionMade(self):
        
        cmd = stomper.connect(self.username, self.password)
        self.transport.write(cmd)
1149612
def _get_service_info(service):
    '''
    
    '''
    service_info = pyconnman.ConnService(os.path.join(SERVICE_PATH, service))
    data = {
        'label': service,
        'wireless': service_info.get_property('Type') == 'wifi',
        'connectionid': six.text_type(service_info.get_property('Ethernet')['Interface']),
        'hwaddr': six.text_type(service_info.get_property('Ethernet')['Address'])
    }

    state = service_info.get_property('State')
    if state == 'ready' or state == 'online':
        data['up'] = True
        data['ipv4'] = {
            'gateway': '0.0.0.0'
        }
        ipv4 = 'IPv4'
        if service_info.get_property('IPv4')['Method'] == 'manual':
            ipv4 += '.Configuration'
        ipv4_info = service_info.get_property(ipv4)
        for info in ['Method', 'Address', 'Netmask', 'Gateway']:
            value = ipv4_info.get(info)
            if value is None:
                log.warning('Unable to get IPv4 %s for service %s\n', info, service)
                continue
            if info == 'Method':
                info = 'requestmode'
                if value == 'dhcp':
                    value = 'dhcp_linklocal'
                elif value in ('manual', 'fixed'):
                    value = 'static'
            data['ipv4'][info.lower()] = six.text_type(value)

        ipv6_info = service_info.get_property('IPv6')
        for info in ['Address', 'Prefix', 'Gateway']:
            value = ipv6_info.get(info)
            if value is None:
                log.warning('Unable to get IPv6 %s for service %s\n', info, service)
                continue
            if 'ipv6' not in data:
                data['ipv6'] = {}
            data['ipv6'][info.lower()] = [six.text_type(value)]

        nameservers = []
        for nameserver_prop in service_info.get_property('Nameservers'):
            nameservers.append(six.text_type(nameserver_prop))
        data['ipv4']['dns'] = nameservers
    else:
        data['up'] = False
        data['ipv4'] = {
            'requestmode': 'disabled'
        }

    data['ipv4']['supportedrequestmodes'] = [
        'static',
        'dhcp_linklocal',
        'disabled'
    ]
    return data
1242805
def _connected(self, link_uri):
        
        print('Connected to %s' % link_uri)
        self._is_link_open = True
        self._connect_event.set()
88412
def do_status(self, service):
        
        if service:
            self.do_show("services", single=service)
        else:
            self.do_show("services")
813184
def connection_made(self, transport):
        """"""
        self.port = transport.serial.port
        logger.debug('connection_made: `%s` `%s`', self.port, transport)
        self.transport = transport
        self.connected.set()
        self.disconnected.clear()
178794
def in_transaction(self):
        
        self._in_transaction = self._in_transaction and self.is_connected
        return self._in_transaction
77293
def connected(self):
        """"""
        ret = [u for u in self.channel.recipients if self.voice_state_for(u) is not None]
        me = self.channel.me
        if self.voice_state_for(me) is not None:
            ret.append(me)

        return ret
1095776
def connection_made(self, transport):
        

        # Save the underlying transport
        self._transport = transport

        # Call connection_made() on the client protocol, passing
        # ourself as the transport
        self._client.connection_made(self)