Event dispatcher fo client and server