Merge pull request #1374 from gurbuzali/improvement/3.x/client-events

added client connect/disconnect events back-port of issue #922(cherry picked from commit fe03ea2688f518300e2d539b06be0df54afaeb9b)