Example #1
0
 def pend_event(self,timeout=None):
     """Flush the send buffer and wait for timeout seconds.
     Parameters:
         timeout: seconds to wait
     """
     if timeout is None:
         timeout = 0.1
     status = ca.pend_event(timeout)
     # status is always ECA_TIMEOUT
     return status
Example #2
0
 def pend_event(self, timeout=None):
     """Flush the send buffer and wait for timeout seconds.
     Parameters:
         timeout: seconds to wait
     """
     if timeout is None:
         timeout = 0.1
     status = ca.pend_event(timeout)
     # status is always ECA_TIMEOUT
     return status
Example #3
0
            finally:
                updated[0] = True
        if req_type is None: req_type = ca.dbf_type_to_DBR(self.field_type())
        if count is None: count = 0
        try:
            ca.get(self.__chid, update_value, req_type, count)
        except ca.error,msg:
            raise CaChannelException,msg
        if self.__timeout is None:
            timeout = CaChannel.ca_timeout
        else:
            timeout = self.__timeout
        status = ca.pend_io(timeout)
        n = 0
        while n*0.02 < timeout and not updated[0]:
            ca.pend_event(0.02)
            n+=1
        if not updated[0]:
            raise CaChannelException, ca.caError._caErrorMsg[10] # ECA_TIMEOUT
        return value[0]

#
# Callback functions
#
# These functions hook user supplied callback functions to CA extension

    def _conn_callback(self):
        try:
            callback, userArgs = self._callbacks.get('connCB')
        except:
            return
Example #4
0
                updated[0] = True

        if req_type is None: req_type = ca.dbf_type_to_DBR(self.field_type())
        if count is None: count = 0
        try:
            ca.get(self.__chid, update_value, req_type, count)
        except ca.error, msg:
            raise CaChannelException, msg
        if self.__timeout is None:
            timeout = CaChannel.ca_timeout
        else:
            timeout = self.__timeout
        status = ca.pend_io(timeout)
        n = 0
        while n * 0.02 < timeout and not updated[0]:
            ca.pend_event(0.02)
            n += 1
        if not updated[0]:
            raise CaChannelException, ca.caError._caErrorMsg[10]  # ECA_TIMEOUT
        return value[0]


#
# Callback functions
#
# These functions hook user supplied callback functions to CA extension

    def _conn_callback(self):
        try:
            callback, userArgs = self._callbacks.get('connCB')
        except: