I'm not sure if this is possible but here we go. I'm building an email module for my application. Basically it refers to an inbox on a mail server, it retrieves all headers of the emails and the details periodically.
The thing I've noticed is that the connection to email itself takes a while i.e 3-5 seconds of waiting time and a connection needs to be made everytime an email is to be retrieved. I was wondering if there is a way to set up a kind of permanent connection. Permanent in the sense that it can be referred to irrespective of state. Like whenever a message needs to be retrieved instead of opening a new connection - an already existing connection is used. Is such a thing possible? I'm using php here btw.