'Release the inotify file descriptor and do the necessary cleanup'

def connectionLost(self, reason):

    FileDescriptor.connectionLost(self, reason)
    if (self._fd >= 0):
        try:
            os.close(self._fd)
        except OSError as e:
            log.err(e, "Couldn't    close    INotify    file    descriptor.")
