title: Subscriber does not receive message, Pyzmq
body: <p>I am trying to publish a message(it's like broadcast when using raw sockets) to my subnet with a known port but at subscriber end, the message is not received. The idea is the IP address of the first machine should not be known to the second machine that's why I am using broadcast IP. With UDP or TCP raw socket, it works but I am trying to learn <code>pub-sub</code> pattern not sure how to incorporate that idea.</p>
  
  <hr>
  
  <p>This is my codes:</p>
  
  <p>Publisher:</p>
  
  <pre><code>import zmq
  import sys
  import time
  context=zmq.Context()
  socket=context.socket(zmq.PUB)
  socket.bind("tcp://192.168.1.255:5677")
  while True:
      data='hello'.encode()
      socket.send(data)
      #time.sleep(1)
  </code></pre>
  
  <p>Subscriber:</p>
  
  <pre><code>context=zmq.Context()
      sub=context.socket(zmq.PUB)
      sub.setsocketopt(zmq.SUBSCRIBE, "".encode())
      sub.connect('tcp://192.168.1.255:5677')
      sub.recv()
      print(sub.recv())
  </code></pre>
  
  <p>In terms of raw UDP, I wrote a code which works perfectly. </p>
  
  <p>broadcast:</p>
  
  <pre><code>def broadcast(Host,port):
      #send bd
      sock=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
      msg=get_ip_data("wlp3s0")
      sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
      time.sleep(1.5)
      # print("yes sending", client)
  
      sock.sendto(msg.encode(), (Host,port))
  </code></pre>
  
  <p>recv:</p>
  
  <pre><code>def broadcast_recv():
      #listen bd
      sock=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
      sock.bind((get_bd_address("wlp1s0"),12345))
      # receive broadcast
      msg, client = sock.recvfrom(1024)
      a=(msg.decode())
      print(a)
  </code></pre>