Unitech/pm2-interface — pull request #5 by achingbrain (2013-12-03 14:24:59+00:00)
Title: create sockets per IPM2 instance

If you create the sockets as file scoped variables, they will be reused by every instance of IPM2.

So if I do:

```javascript
var pm2Interface = require('pm2-interface');

var imp2a = pm2Interface('localhost');
var imp2b = pm2Interface('some.remote.host');
```

`imp2a` and `imp2b` actually share event and rpc sockets which is probably not what was intended.

The change I've made moves the socket creation into the IPM2 constructor so that in the above example both connections would have their own sockets.