in reply to Re^2: How to reuse a Soket and how it will work
in thread How to reuse a Soket and how it will work

What makes you optimize this part of the code(Socket creation), IMO creating socket for every IVR instance is a good idea and it won't affect the start of your application much.
if you want to make your script efficient/optimize there may be other areas in your script where you have to look in for optimization.
storing the socket handle, database handle etc; for later re-use is not needed in this case.
because if you take IVR other side caller is not going to be a machine; 99% of the times it would be human, to create and initialize a socket it won't take that much of time (it would happen in micro seconds or even less), the caller or you wouldn't even see a delay in execution speed of the script in this socket creation and initialization part.

Vivek
-- In accordance with the prarabdha of each, the One whose function it is to ordain makes each to act. What will not happen will never happen, whatever effort one may put forth. And what will happen will not fail to happen, however much one may seek to prevent it. This is certain. The part of wisdom therefore is to stay quiet.
  • Comment on Re^3: How to reuse a Soket and how it will work