示例#1
0
    def closeTransport(self):
        DgramSocketTransport.closeTransport(self)

        try:
            os.remove(self._iface)

        except OSError:
            pass
示例#2
0
 def openClientMode(self, iface=None):
     if iface is None:
         # UNIX domain sockets must be explicitly bound
         iface = ''
         while len(iface) < 8:
             iface += chr(random.randrange(65, 91))
             iface += chr(random.randrange(97, 123))
         iface = os.path.sep + 'tmp' + os.path.sep + 'pysnmp' + iface
     if os.path.exists(iface):
         os.remove(iface)
     DgramSocketTransport.openClientMode(self, iface)
     self._iface = iface
     return self
示例#3
0
文件: unix.py 项目: bbmorten/pysnmp
 def openClientMode(self, iface=None):
     if iface is None:
         # UNIX domain sockets must be explicitly bound
         iface = ''
         while len(iface) < 8:
             iface += chr(random.randrange(65, 91))
             iface += chr(random.randrange(97, 123))
         iface = os.path.sep + 'tmp' + os.path.sep + 'pysnmp' + iface
     if os.path.exists(iface):
         os.remove(iface)
     DgramSocketTransport.openClientMode(self, iface)
     self._iface = iface
     return self
示例#4
0
 def openServerMode(self, iface):
     DgramSocketTransport.openServerMode(self, iface)
     self._iface = iface
     return self
示例#5
0
文件: unix.py 项目: etingof/pysnmp
 def openServerMode(self, iface):
     DgramSocketTransport.openServerMode(self, iface)
     self._iface = iface
     return self