def _set_stop_server_timeout_ms(self, ms): """ Setter. Raise exception if a problem occurs. :param ms: Time out in ms. :type ms: int """ cms = SolBase.to_int(ms) if not SolBase.is_int(cms): logger.error("not a int, class=%s", SolBase.get_classname(cms)) raise Exception("not a int") else: self._stop_server_timeout_ms = cms
def _set_target_port(self, target_port): """ Setter. Raise exception if a problem occurs. :param target_port: The target port. :type target_port: int """ if not SolBase.is_int(target_port): logger.error( "TcpClientConfig : _set_target_port : not a int, class=%s", SolBase.get_classname(target_port)) raise Exception("TcpClientConfig : _set_target_port : not a int") elif target_port == 0: logger.warning("TcpClientConfig : _set_target_port : newPort==0") raise Exception("TcpClientConfig : _set_target_port : newPort==0") else: self._target_port = target_port
def _set_child_process_count(self, cpc): """ Setter. Raise exception if a problem occurs. :param cpc: The number of child process count. If zero, no fork is performed (default). :type cpc: int """ child_process_count = SolBase.to_int(cpc) if not SolBase.is_int(child_process_count): logger.error("not a int, class=%s", SolBase.get_classname(child_process_count)) raise Exception("not a int") elif child_process_count < 0: logger.warning("child_process_count<0") raise Exception("child_process_count<0") else: self._child_process_count = child_process_count
def _set_listen_port(self, listen_port): """ Setter. Raise exception if a problem occurs. :param listen_port: The listen port. :type listen_port: int """ listen_port = SolBase.to_int(listen_port) if not SolBase.is_int(listen_port): logger.error("not a int, class=%s", SolBase.get_classname(listen_port)) raise Exception("not a int") elif listen_port == 0: logger.warning("newPort==0") raise Exception("newPort==0") else: self._listen_port = listen_port
def _set_tcpkeepalive_probes_sendintervalms(self, value): """ Setter. Raise exception if a problem occurs. :param value: Value. :type value: int """ if not SolBase.is_int(value): logger.error( "TcpClientConfig : _set_tcpkeepalive_probes_sendintervalms : not a int, class=%s", SolBase.get_classname(value)) raise Exception( "TcpClientConfig : _set_tcpkeepalive_probes_sendintervalms : not a int" ) elif value == 0: logger.warning( "TcpClientConfig : _set_tcpkeepalive_probes_sendintervalms : newPort==0" ) raise Exception( "TcpClientConfig : _set_tcpkeepalive_probes_sendintervalms : newPort==0" ) else: self._tcp_keepalive_probes_sendintervalms = value