Added client and server objects to the  macro
[test] Added test to ensure all producers are removed when a client closes