implementing a management of connections on ports