class_docstr: The ZMQ socket object
  
  To create a Socket, first create a Context::
  
      ctx = zmq.Context.instance()
  
  then call ``ctx.socket(socket_type)``::
  
      s = ctx.socket(zmq.ROUTER)
class_docstr_tok: ["The","ZMQ","socket","object","To","create","a","Socket",",","first","create","a","Context",":",":","ctx","=","zmq.Context.instance","(",")","then","call","``","ctx.socket","(","socket_type",")","``",":",":","s","=","ctx.socket","(","zmq.ROUTER",")"]
docstr: Poll the socket for events.
  See :class:`Poller` to wait for multiple sockets at once.
  
  Parameters
  ----------
  timeout : int [default: None]
      The timeout (in milliseconds) to wait for an event. If unspecified
      (or specified None), will wait forever for an event.
  flags : int [default: POLLIN]
      POLLIN, POLLOUT, or POLLIN|POLLOUT. The event flags to poll for.
  
  Returns
  -------
  event_mask : int
      The poll event mask (POLLIN, POLLOUT),
      0 if the timeout was reached without an event.
docstr_tok: ["Poll","the","socket","for","events",".","See",":","class",":","`","Poller","`","to","wait","for","multiple","sockets","at","once",".","Parameters","--","--","--","--","--","timeout",":","int","[","default",":","None","]","The","timeout","(","in","milliseconds",")","to","wait","for","an","event",".","If","unspecified","(","or","specified","None",")",",","will","wait","forever","for","an","event",".","flags",":","int","[","default",":","POLLIN","]","POLLIN",",","POLLOUT",",","or","POLLIN|POLLOUT",".","The","event","flags","to","poll","for",".","Returns","--","--","--","-","event_mask",":","int","The","poll","event","mask","(","POLLIN",",","POLLOUT",")",",","0","if","the","timeout","was","reached","without","an","event","."]
code: def poll(self, timeout=None, flags=POLLIN):
      """Poll the socket for events.
      See :class:`Poller` to wait for multiple sockets at once.
  
      Parameters
      ----------
      timeout : int [default: None]
          The timeout (in milliseconds) to wait for an event. If unspecified
          (or specified None), will wait forever for an event.
      flags : int [default: POLLIN]
          POLLIN, POLLOUT, or POLLIN|POLLOUT. The event flags to poll for.
  
      Returns
      -------
      event_mask : int
          The poll event mask (POLLIN, POLLOUT),
          0 if the timeout was reached without an event.
      """
  
      if self.closed:
          raise ZMQError(ENOTSUP)
  
      p = self._poller_class()
      p.register(self, flags)
      evts = dict(p.poll(timeout))
      # return 0 if no events, otherwise return event bitfield
      return evts.get(self, 0)
  
imports: import errno
  import random
  import sys
  import warnings
  import zmq
  from zmq.backend import Socket
  from .poll import Poller
  from .None import constants
  from .attrsettr import AttributeSetter
  from zmq.error import ZMQError, ZMQBindError
  from zmq.utils import jsonapi
  from zmq.utils.strtypes import bytes, unicode, basestring
  from .constants import SNDMORE, ENOTSUP, POLLIN, int64_sockopt_names, int_sockopt_names, bytes_sockopt_names, fd_sockopt_names
label_desc: Use image node_id 31 for calling the Socket obj's underlying member method code with example usage: obj.poll(timeout, flags) and returns: evts