Create a PUB-style socket for data publishers.
        If <connect> is true, connects to a XPUB/XSUB forwarding device.

def publisherSocket(self,
                        port,
                        connect=False,
                        host='*',
                        hwm=1):
        '''
        Create a PUB-style socket for data publishers.
        If <connect> is true, connects to a XPUB/XSUB forwarding device.
        '''
        socket = self._context.socket(zmq.PUB)
        socket.setsockopt(zmq.SNDHWM, hwm)
        socket.setsockopt(zmq.LINGER, 0)

        try:
            if connect:
                socket.connect(self.tcpAddress(host, port))
            else:
                socket.bind(self.tcpAddress(host, port))
        except Exception as e:
            newMsg= str("%s %s:%d" % (str(e), host, port))
            raise (type(e))(newMsg)
        return socket