Exemple #1
0
    BaseProxy::BaseProxy(
            ServerInfo serverinfo,
            int32_t maxConn,
            bool initConsNow,
            ServiceManager* service_manager,
            int32_t tryCount,
            int32_t tryInterval)
        :_serverinfo(serverinfo.getIP(),serverinfo.getPort()),
        _service_manager(service_manager)
    {
        _name = StringUtil::generate_uuid();
        _nMaxConn = maxConn;
        _tryCount = tryCount;
        _tryInterval = tryInterval;
		_seqid=~0;
		_use_existing_socket=false;
#ifndef _WIN32
        signal(SIGPIPE, SIG_IGN);
#endif
        if(initConsNow){
            init(INIT_ALL);
        }
		else{
			init(INIT_CALLBACK);
		}
    }
Exemple #2
0
    BaseProxy::BaseProxy(
            ServerInfo serverinfo,
            int32_t nprotocols,
            ServiceManager* service_manager,
            int32_t tryCount,
            int32_t tryInterval)
        :_serverinfo(serverinfo.getIP(),serverinfo.getPort()),
        _service_manager(service_manager)
    {
        _name = StringUtil::generate_uuid();
        _nProtocols = nprotocols;
        _tryCount = tryCount;
        _tryInterval = tryInterval;

        init();
    }