Client and server emit events