added a callback for connect / disconnect so the server can perform any custom logic required.