예제 #1
0
파일: ZList.cpp 프로젝트: naazgull/zapata
zpt::redis::ZList::ZList(zpt::json _options, std::string _conf_path) : __options(_options), __conn(nullptr) {
	try {
		std::string _bind((std::string)_options->getPath(_conf_path)["bind"]);
		std::string _address(_bind.substr(0, _bind.find(":")));
		uint _port = std::stoi(_bind.substr(_bind.find(":") + 1));
		this->connection(_options->getPath(_conf_path) + zpt::json{"host", _address, "port", _port});
	} catch (std::exception& _e) {
		assertz(false, std::string("could not connect to Redis server: ") + _e.what(), 500, 0);
	}
}
예제 #2
0
파일: parser.c 프로젝트: radare/defora-cc
/* operand */
static int _operand(State * state)
	/* value | address */
{
#ifdef DEBUG
	fprintf(stderr, "DEBUG: %s()\n", __func__);
#endif
	if(_parser_in_set(state, TS_VALUE))
		return _value(state);
	else if(_parser_in_set(state, TS_ADDRESS))
		return _address(state);
	return _parser_error(state, "%s", "Expected value or address");
}
예제 #3
0
 Address::Address(struct sockaddr_in address)
 {
     _address(inet_ntoa(address.sin_addr), address.sin_port);
 }
예제 #4
0
 Address::Address(Ip ip, Port port)
 {
     _address(ip, port);
 }
예제 #5
0
 Address::Address(Port port)
 {
     _address("0.0.0.0", port);
 }
예제 #6
0
 Address::Address()
 {
     _address("0.0.0.0", 0);
 }