Start the PLM connection process.

        Called when asyncio.Protocol establishes the network connection.
429489
def connection_made(self, transport):
        
        _LOGGER.info('Connection established to PLM')
        self.transport = transport

        self._restart_writer = True
        self.restart_writing()

        # Testing to see if this fixes the 2413S issue
        self.transport.serial.timeout = 1
        self.transport.serial.write_timeout = 1
        self.transport.set_write_buffer_limits(128)
        # limit = self.transport.get_write_buffer_size()
        # _LOGGER.debug('Write buffer size is %d', limit)
        if self._aldb.status != ALDBStatus.LOADED:
            asyncio.ensure_future(self._setup_devices(), loop=self._loop)
848326
def run(self):
        '''
        
        '''
        listen_ip = self._config.get(self.LISTEN_IP, self.DEFAULTS[self.LISTEN_IP])
        port = self._config.get(self.PORT, self.DEFAULTS[self.PORT])
        self.log.info('Starting service discovery listener on udp://%s:%s', listen_ip, port)
        loop = asyncio.get_event_loop()
        protocol = SSDPFactory(answer=self._config[self.ANSWER])
        if asyncio.ported:
            transport, protocol = loop.run_until_complete(
                SSDPDiscoveryServer.create_datagram_endpoint(loop, protocol, local_addr=(listen_ip, port)))
        else:
            transport, protocol = loop.run_until_complete(
                loop.create_datagram_endpoint(protocol, local_addr=(listen_ip, port), allow_broadcast=True))
        try:
            loop.run_forever()
        finally:
            self.log.info('Stopping service discovery listener.')
            transport.close()
            loop.close()
1034444
void start(Future<DataPort> dataPortFuture) {
        this.startStopLock.lock();
        try {
            this.dataPortFuture = dataPortFuture;
            this.running.set(true);
            this.outgoing.resume();
            this.reconnectOutgoing.resume();
            this.stopped = connection.getExecutor().submit(this, Boolean.TRUE);
        } finally {
            this.startStopLock.unlock();
        }
    }
376443
async def start(self):
        """"""

        while True:
            try:
                data = await self.reader.read(8192)

                if self._trace_enabled:
                    self._logger.trace(
                        "Received %d bytes from remote server:\n%s",
                        len(data),
                        msg.dump(data),
                    )
                await self.process(data)
            except asyncio.CancelledError:
                return
            except:
                logging.exception("Unhandled error in Message Reader")
                raise
600833
def start(io_loop=None, check_time=2):

    
    io_loop = io_loop or asyncio.get_event_loop()
    if io_loop in _io_loops:
        return
    _io_loops[io_loop] = True
    if len(_io_loops) > 1:
        logger.warning("aiohttp_autoreload started more than once in the same process")
    # if _has_execv:
    #     add_reload_hook(functools.partial(io_loop.close, all_fds=True))
    modify_times = {}
    callback = functools.partial(_reload_on_update, modify_times)
    logger.debug("Starting periodic checks for code changes")
    call_periodic(check_time, callback, loop=io_loop)
636242
def connect_async(self, conn_id, connection_string, callback):
        """"""

        future = self._loop.launch_coroutine(self._adapter.connect(conn_id, connection_string))
        future.add_done_callback(lambda x: self._callback_future(conn_id, x, callback))
740555
def start(self):
        
        if self.via_ip:
            connect_to = self.via_ip
            self.description = '[%s@%s via %s]' % (self._user,
                                                   self._hostname,
                                                   self.via_ip)
        else:
            connect_to = self._hostname
            self.description = '[%s@%s]' % (self._user,
                                            self._hostname)

        exception = None
        for i in range(60):
            try:
                self._client.connect(
                    connect_to,
                    username=self._user,
                    allow_agent=True,
                    key_filename=self._key_filename)
            # NOTE(Gonéri): TypeError is in the list because of
            # https://github.com/paramiko/paramiko/issues/615
                self._transport = self._get_transport()
            except (OSError,
                    TypeError,
                    ssh_exception.SSHException,
                    ssh_exception.NoValidConnectionsError) as e:
                exception = e
                LOG.info('%s waiting for %s: %s' %
                         (self.description, connect_to, str(exception)))
                time.sleep(1)
            else:
                LOG.debug('%s connected' % self.description)
                self._started = True
                return

        _error = ("unable to connect to ssh service on '%s': %s" %
                  (self._hostname, str(exception)))
        LOG.error(_error)
        raise exception
236089
def start(self):
        

        self.debug_print("Starting networking.")
        self.debug_print("Make sure to iterate over replies if you need"
                         " connection alive management!")

        # Register a cnt + c handler
        signal.signal(signal.SIGINT, self.stop)

        # Save WAN IP.
        self.debug_print("WAN IP = " + str(self.wan_ip))

        # Check rendezvous server is up.
        try:
            rendezvous_con = self.rendezvous.server_connect()
            rendezvous_con.close()
        except:
            raise Exception("Unable to connect to rendezvous server.")

        # Started no matter what
        # since LAN connections are always possible.
        self.start_passive_server()

        # Determine NAT type.
        if self.nat_type == "unknown":
            self.debug_print("Determining NAT type.")
            nat_type = self.rendezvous.determine_nat()
            if nat_type is not None and nat_type != "unknown":
                self.nat_type = nat_type
                self.rendezvous.nat_type = nat_type
                self.debug_print("NAT type = " + nat_type)
            else:
                self.debug_print("Unable to determine NAT type.")

        # Check NAT type if node is simultaneous
        # is manually specified.
        if self.node_type == "simultaneous":
            if self.nat_type not in self.rendezvous.predictable_nats:
                self.debug_print("Manual setting of simultanous specified but"
                                 " ignored since NAT does not support it.")
                self.node_type = "active"
        else:
            # Determine node type.
            self.debug_print("Determining node type.")

            # No checks for manually specifying passive
            # (there probably should be.)
            if self.node_type == "unknown":
                self.node_type = self.determine_node()

        # Prevent P2P nodes from running as simultaneous.
        if self.net_type == "p2p":
            """
            TCP hole punching is reserved specifically for direct networks
            (a net object reserved for receiving direct connections
            -- p2p is for connecting to the main network. The reason for this
            is you can't do multiple TCP hole punches at the same time so
            reserved for direct network where it's most needed.
            """
            if self.node_type == "simultaneous":
                self.debug_print("Simultaneous is not allowed for P2P")
                self.node_type = "active"
                self.disable_simultaneous()

        self.debug_print("Node type = " + self.node_type)

        # Close stray cons from determine_node() tests.
        self.close_cons()

        # Set net started status.
        self.is_net_started = 1

        # Initialise our UNL details.
        self.unl = UNL(
            net=self,
            dht_node=self.dht_node,
            wan_ip=self.wan_ip
        )

        # Nestled calls.
        return self
243374
def _start_new_worker_process(self, server_socket):
        """"""
        from multiprocessing import Process
        p = Process(target=forked_child, args=self._get_child_args(server_socket))
        p.start()
        return p
52526
async def client_start(self):
        
        await self._start_socket()
        await self._on_connect()

        self._ping_count = 0

        # Start the loops, and don't forget to add them to the list of asyncio task to close when the client restarts
        task_socket = self._loop.create_task(self._run_socket())
        task_ping = self._loop.create_task(self._do_ping())

        self._restartable_tasks.append(task_ping)
        self._restartable_tasks.append(task_socket)
717527
def open(self):
        
        LOGGER.info('Connecting to %s', self._url)
        asyncio.ensure_future(self._do_start())
767196
def run(self):
        
        self._connection = self.connect()
        self._connection.ioloop.start()
794247
def Start(self):
    """"""
    self.CallClient(
        server_stubs.PlistQuery,
        request=self.args.request,
        next_state="Receive")
1318647
def start(self):
        
        if not self.thread_started:
            super(SkypeAPI, self).start()
            self.thread_started = True
590333
async def start(self, remoteParameters):
        
        if self.state == 'closed':
            raise InvalidStateError('RTCIceTransport is closed')

        # handle the case where start is already in progress
        if self.__start is not None:
            return await self.__start.wait()
        self.__start = asyncio.Event()

        self.__setState('checking')
        self._connection.remote_username = remoteParameters.usernameFragment
        self._connection.remote_password = remoteParameters.password
        try:
            await self._connection.connect()
        except ConnectionError:
            self.__setState('failed')
        else:
            self.__setState('completed')
        self.__start.set()
912021
public void start() {
        IoFutureListener<ConnectFuture> tmpConnectListener;
        if (interval > 0) {
            tmpConnectListener = new IoFutureListener<ConnectFuture>() {
                @Override
                public void operationComplete(ConnectFuture future) {
                    heartbeatFilter.setServiceConnected(future.isConnected());
                    updateConnectTimes(future.isConnected());
                }
            };
        } else {
            tmpConnectListener = new IoFutureListener<ConnectFuture>() {
                @Override
                public void operationComplete(ConnectFuture future) {
                    updateConnectTimes(future.isConnected());
                }
            };
        }
        final IoFutureListener<ConnectFuture> connectListener = tmpConnectListener;

        // set a connection pool with GT 0 prepared connections in every worker thread as an optimization
        Worker[] workers = tcpAcceptor.getWorkers();
        assert preparedConnectionCount == 0 || preparedConnectionCount >= workers.length : "Prepared connection count must be 0, or >= number of IO threads";
        int minCountPerThread = preparedConnectionCount / workers.length;
        int remainder = preparedConnectionCount % workers.length;
        for (Worker worker : workers) {
            final int count = remainder-- > 0 ? minCountPerThread + 1 : minCountPerThread;
            Runnable startConnectionPoolTask = () -> {
                ConnectionPool currentPool = connectionPool.get();
                if (currentPool == null) {
                    // the first time the pool is started is needs to be created, subsequent times it should just be started
                    // without re-creating.
                    currentPool = new ConnectionPool(serviceCtx, connectHandler, connectURI, heartbeatFilter,
                            connectListener, count, true);
                    connectionPool.set(currentPool);
                }
                currentPool.start();
            };
            worker.executeInIoThread(startConnectionPoolTask);
        }
    }
256132
def _connect(self):
        """"""
        try:
            while True:
                _LOGGER.info('Trying to connect to %s', self.server_address)
                try:
                    yield from asyncio.wait_for(
                        self.loop.create_connection(
                            lambda: self.protocol, *self.server_address),
                        self.reconnect_timeout, loop=self.loop)
                    self.tcp_check_timer = time.time()
                    self.tcp_disconnect_timer = time.time()
                    self._check_connection()
                    return
                except asyncio.TimeoutError:
                    _LOGGER.error(
                        'Connecting to socket timed out for %s',
                        self.server_address)
                    _LOGGER.info(
                        'Waiting %s secs before trying to connect again',
                        self.reconnect_timeout)
                    yield from asyncio.sleep(
                        self.reconnect_timeout, loop=self.loop)
                except OSError:
                    _LOGGER.error(
                        'Failed to connect to socket at %s',
                        self.server_address)
                    _LOGGER.info(
                        'Waiting %s secs before trying to connect again',
                        self.reconnect_timeout)
                    yield from asyncio.sleep(
                        self.reconnect_timeout, loop=self.loop)
        except asyncio.CancelledError:
            _LOGGER.debug(
                'Connect attempt to %s cancelled', self.server_address)