Connection to the server
4545
def server(self):
        
        if self._server is None:
            self._server = bugzilla.Bugzilla(url=self.parent.url)
        return self._server
1197255
async def connect(self) -> Connection:
        
        if self._conn is None:
            self._conn = await r.connect(host=self._host,
                                         port=self._port,
                                         db=self._db,
                                         auth_key=self._auth_key,
                                         user=self._user,
                                         password=self._password,
                                         timeout=self._timeout,
                                         ssl=self._ssl,
                                         io_loop=self._loop)
        return self._conn
281276
protected function connect()
    {
        $this->client = new Client(array(
            'host'   => $this->instance->getHost(),
            'port'   => $this->instance->getPort(),
        ));
    }
610829
public function Connect ()
	{
		
		// Development Mode
		
		if ($this->dev)
		{
			
			// Add to log
			
			$this->log[]	= 'Connection Attempt';
			
		}
		
		// Check to see if the stream is already connected
		
		if ($this->_stream === FALSE)
		{
			
			// Attempt to connect to the stream
			
			$this->_stream	= stream_socket_client ($this->url . ':' . $this->port, $this->errorCode, $this->errorMessage, $this->timeout);
			
			// If the connection failed
			
			if ($this->_stream === FALSE)
			{
				
				// Development Mode
				
				if ($this->dev)
				{
					
					// Add to log
					
					$this->log[]	= 'Cannot to connect to ' . $this->url . ':' . $this->port;
					
				}
				
				// Create an error
				
				$this->Error ('The stream could not connect: #' . $this->errorCode . ' - ' . $this->errorMessage);
				return;
				
			}
			
			// Development Mode
			
			else if ($this->dev)
			{
				
				// Add to log
				
				$this->log[]	= 'Connected to ' . $this->url . ':' . $this->port;
				
			}
			
			// Set blocking
			
			stream_set_blocking ($this->_stream, 1);
			
		}
		
		// If the stream is connected
		
		else
		{
			
			// Development Mode
			
			if ($this->dev)
			{
				
				// Add to log
				
				$this->log[]	= 'Cannot to connect to ' . $this->url . ':' . $this->port;
				
			}
			
			// Create an error
			
			$this->Error ('The stream is already connected!');
			
		}
		
	}
319227
def s_connect(self, server, port, r_server=None):
        
        with self.lock:
            if not r_server:
                self.send('CONNECT %s %s' % (server, port), error_check=True)
            else:
                self.send('CONNECT %s %s %s' % (server, port, \
                                    r_server), error_check=True)
135747
protected function connect()
    {
        if (!$this->object) {
            $this->object = new \Memcache;
        }
        foreach ($this->servers as $server) {
            call_user_func_array(array($this->object, 'addServer'), $server);
        }
    }
33561
def connect(self):
        
        self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        try:
            self.socket.connect((self.host, self.port))
        except socket.error as (err, msg):
            self.connected = False
            raise ScratchError("[Errno %d] %s" % (err, msg))
        self.connected = True
1013814
def main(self):
        
        try:
            self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
            self.sock.bind((self.host, self.port))
            self.sock.listen(5)
            self.sock.settimeout(END_RESP)
            
            self.stop = self.terminate = False
            
            while not (self.stop or self.terminate):
                try:
                    conn, addr = self.sock.accept()
                except socket.error:
                    # We have timed out, hurry and get back to accept those 
                    # connections!
                    pass
                except KeyboardInterrupt:
                    # We've been told to quit, do so!
                    self.terminate_server()
                else:
                    threaded(self._handler, (conn,))
            
            while not self.terminate:
                time.sleep(END_RESP)
            # We are done, the finally will close the socket.
        finally:
            self.sock.close()
1238772
private function connecting() : void
    {
        $this->connected = false;
        $this->closing
            ? $this->closed()->resolve()
            : $this->client = Socket::connect($this->endpoint, $this->events)
        ;
    }
1110678
private function connect()
    {
        $this->conn = parent::getConn();
        $this->read = $this->conn->prepare($this->sql);
        $this->read->setFetchMode(\PDO::FETCH_ASSOC);
    }
1334642
def receive_connection():
    
    server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
    server.bind(("localhost", 8080))
    server.listen(1)
    client = server.accept()[0]
    server.close()
    return client
837226
public function connect()
    {
        list($host, $port) = explode(':', $this->getServer());
        if ($this->stream->open($host, $port, $this->getTimeout()) === false) {
            throw new Exception(sprintf('Cannot connect to server %s', $this->getServer()), Exception::SERVER_OFFLINE);
        }

        return true;
    }
412051
public void connect() {
        try {
            ws.setPingInterval(pingInterval);
            ws.connect();
        } catch (WebSocketException e){
            e.printStackTrace();
            if(onErrorListener != null) {
                onErrorListener.onError(e);
            }
            if(tryReconnection) {
                if (timer == null) {
                    // this is to handle reconnection first time
                    if (lastPongAt == 0) {
                        lastPongAt = 1;
                    }
                    timer = new Timer();
                    timer.scheduleAtFixedRate(getTask(), 0, pongCheckInterval);
                }
            }
        }
    }
1018050
def connect(self):
        """"""
        self.socket = socket.create_connection(self.address, self.timeout)
15154
private function connect()
    {
        $server = $this->config['server'];
        if (isset($this->config['ssl']) && $this->config['ssl'] == true) {
            $server = 'ssl://' . $server;
        }

        stream_set_blocking(STDIN, 0);
        $this->socket = fsockopen($server, $this->config['port']);

        return (bool) $this->socket;
    }
106726
function connect() {
    // clear pending timeouts
    clearTimeout(timeoutConnectRef);

    // if client already open, just run
    if (client.isOpen) {
        run();
    }

    // if client closed, open a new connection
    client.connectTCP("127.0.0.1", { port: 8502 })
        .then(setClient)
        .then(function() {
            console.log("Connected"); })
        .catch(function(e) {
            checkError(e);
            console.log(e.message); });
}
987387
public function connect()
    {
        $connection = null;

        /**
         * @todo we need a SQLLogger that logs to a (CSV?) file, as we probably do not want to log into the database.
         *
         * $configuration->setSQLLogger(new EchoSQLLogger());
         */

        try {
            $connection = $this->getConnectionFromDriverManager();
            $connection->connect();

            $this->setConnection($connection);

            $this->ensureConnectionIsEstablished($connection);
        } catch (DBALException $exception) {
            $exception = $this->convertException($exception);
            $this->handleException($exception);
        } catch (PDOException $exception) {
            $exception = $this->convertException($exception);
            $this->handleException($exception);
        }
    }