Code Monkey home page Code Monkey logo

Comments (3)

boenrobot avatar boenrobot commented on July 30, 2024

A connection is still created once when the PHP process starts and persists until the PHP process closes.

How many requests you can handle with the same connection depends on your web server config.

If you are running PHP as an apache module f.e., then PHP is tied to Apache's process, so the connection will only be gone if you restart Apache.

In the case of FastCGI, there's a "recycle" time and number of requests. Whenever a "recycle" occurs, persistent data is lost.

from net_routeros.

lpcs007 avatar lpcs007 commented on July 30, 2024

I use Apache module. So it means that the connection remains open until Apache is restarted. Even so, whenever I make a request, a new connection is initiated with mikrotik (but not closed). What I need is for a function to start the connection with mikrotik and when I have a new request, it should be done with the connection that is already open. How do I save this open connection for use in subsequent requests?

ie:

$RadiusServer = new RouterOS\Client('ip', 'user', 'pass', null, true);
$connection = $RadiusServer->persistentId;

if($connection){
  $util = new RouterOS\Util($connection);
  $util->setMenu('/ip arp');
  print_r($util->getAll());
}

from net_routeros.

boenrobot avatar boenrobot commented on July 30, 2024

There is no persistentId property, so how are you getting that?

Anyway... I'm not entirely sure why that happens. Can you give me your versions involved? Apache version, PHP version, APC(u) version, MikroTik version, OS version? Any one of those could be the cause, as persistent connections are kind of a hack job to be honest.

from net_routeros.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.