0. PUB/SUB, XPUB/XSUB filtering happens at publisher sides when sockets are using a connected protocol(tcp or ipc or inproc) there are meta-info exchange between SUB and PUB, but on API level,only allow message to flow from PUB to SUB. SUB socket can…