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: Return a connected PAIR socket ready to receive the event notifications.
  
  .. versionadded:: libzmq-4.0
  .. versionadded:: 14.0
  
  Parameters
  ----------
  events : int [default: ZMQ_EVENT_ALL]
      The bitmask defining which events are wanted.
  addr :  string [default: None]
      The optional endpoint for the monitoring sockets.
  
  Returns
  -------
  socket :  (PAIR)
      The socket is already connected and ready to receive messages.
docstr_tok: ["Return","a","connected","PAIR","socket","ready","to","receive","the","event","notifications",".","..","versionadded",":",":","libzmq-4.0","..","versionadded",":",":","14.0","Parameters","--","--","--","--","--","events",":","int","[","default",":","ZMQ_EVENT_ALL","]","The","bitmask","defining","which","events","are","wanted",".","addr",":","string","[","default",":","None","]","The","optional","endpoint","for","the","monitoring","sockets",".","Returns","--","--","--","-","socket",":","(","PAIR",")","The","socket","is","already","connected","and","ready","to","receive","messages","."]
code: def get_monitor_socket(self, events=None, addr=None):
      """Return a connected PAIR socket ready to receive the event notifications.
  
      .. versionadded:: libzmq-4.0
      .. versionadded:: 14.0
  
      Parameters
      ----------
      events : int [default: ZMQ_EVENT_ALL]
          The bitmask defining which events are wanted.
      addr :  string [default: None]
          The optional endpoint for the monitoring sockets.
  
      Returns
      -------
      socket :  (PAIR)
          The socket is already connected and ready to receive messages.
      """
      # safe-guard, method only available on libzmq >= 4
      if zmq.zmq_version_info() < (4,):
          raise NotImplementedError(
              "get_monitor_socket requires libzmq >= 4, have %s"
              % zmq.zmq_version()
          )
  
      # if already monitoring, return existing socket
      if self._monitor_socket:
          if self._monitor_socket.closed:
              self._monitor_socket = None
          else:
              return self._monitor_socket
  
      if addr is None:
          # create endpoint name from internal fd
          addr = "inproc://monitor.s-%d" % self.FD
      if events is None:
          # use all events
          events = zmq.EVENT_ALL
      # attach monitoring socket
      self.monitor(addr, events)
      # create new PAIR socket and connect it
      self._monitor_socket = self.context.socket(zmq.PAIR)
      self._monitor_socket.connect(addr)
      return self._monitor_socket
  
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 32 for calling the Socket obj's underlying member method code with example usage: obj.get_monitor_socket(events, addr) and returns: self, self