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: Close the socket.
  
  If linger is specified, LINGER sockopt will be set prior to closing.
  
  Note: closing a zmq Socket may not close the underlying sockets
  if there are undelivered messages.
  Only after all messages are delivered or discarded by reaching the socket's LINGER timeout
  (default: forever)
  will the underlying sockets be closed.
  
  This can be called to close the socket by hand. If this is not
  called, the socket will automatically be closed when it is
  garbage collected.
docstr_tok: ["Close","the","socket",".","If","linger","is","specified",",","LINGER","sockopt","will","be","set","prior","to","closing",".","Note",":","closing","a","zmq","Socket","may","not","close","the","underlying","sockets","if","there","are","undelivered","messages",".","Only","after","all","messages","are","delivered","or","discarded","by","reaching","the","socket","'s","LINGER","timeout","(","default",":","forever",")","will","the","underlying","sockets","be","closed",".","This","can","be","called","to","close","the","socket","by","hand",".","If","this","is","not","called",",","the","socket","will","automatically","be","closed","when","it","is","garbage","collected","."]
code: def close(self, linger=None):
      """
      Close the socket.
  
      If linger is specified, LINGER sockopt will be set prior to closing.
  
      Note: closing a zmq Socket may not close the underlying sockets
      if there are undelivered messages.
      Only after all messages are delivered or discarded by reaching the socket's LINGER timeout
      (default: forever)
      will the underlying sockets be closed.
  
      This can be called to close the socket by hand. If this is not
      called, the socket will automatically be closed when it is
      garbage collected.
      """
      if self.context:
          self.context._rm_socket(self)
      super(Socket, self).close(linger=linger)
  
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 7 for calling the Socket obj's underlying member method code with example usage: obj.close(linger) without return types