Beispiel #1
0
	VarValue Call(RCString method, const vector<VarValue>& params = vector<VarValue>()) {
		Ext::WebClient wc = GetWebClient();
		wc.Proxy = nullptr;		//!!!?
		wc.CacheLevel = RequestCacheLevel::BypassCache;
		wc.Credentials.UserName = !Login.empty() ? Login : RpcUrl.UserName;
		wc.Credentials.Password = !Password.empty() ? Password : RpcUrl.Password;

		String sjson;
		try {
			DBG_LOCAL_IGNORE_CONDITION_OBJ(error_condition(500, http_category()));

			sjson = wc.UploadString(RpcUrl.ToString(), JsonRpc.Request(method, params));
		} catch (WebException& ex) {
			if (ex.code() == http_error::unauthorized)
				throw;
			sjson = ex.Result;
		}
#ifdef X_DEBUG//!!!D
		cout << sjson << endl;
#endif

		EXT_LOCKED(MtxHeaders, Headers = wc.get_ResponseHeaders());
/*!!!R			XStratum = h.Get("X-Stratum");
			XSwitchTo = h.Get("X-Switch-To");
			XHostList = h.Get("X-Host-List");*/

		return JsonRpc.ProcessResponse(ParseJson(sjson));
	}
bool connection_engine::dispatch() {
    if (collector_.get()) {
        for (pn_event_t *e = pn_collector_peek(collector_.get());
             e;
             e = pn_collector_peek(collector_.get()))
        {
            proton_event pe(e, container_);
            try {
                pe.dispatch(*handler_);
            } catch (const std::exception& e) {
                disconnected(error_condition("exception", e.what()));
            }
            pn_collector_pop(collector_.get());
        }
    }
    return !(pn_transport_closed(unwrap(transport_)));
}
Beispiel #3
0
 inline error_condition error_category::default_error_condition( int ev ) const
 { 
   return error_condition( ev, *this );
 }
Beispiel #4
0
 //  implicit conversion:
 inline error_condition make_error_condition( errc_t e )
   { return error_condition( e, generic_category() ); }
Beispiel #5
0
inline
error_condition make_error_condition( coroutines::coroutine_errc e) //BOOST_NOEXCEPT
{
    return error_condition( underlying_cast< int >( e), coroutines::coroutine_category() );
}
Beispiel #6
0
//main function
int main()
{
	initialize_Symbol_Table();
	
	remove("a4_1.out");
	
	char input[1000];
	
	token t;
	int i;
	
	//loop for rading lines of source code into input buffer	
	while(gets(input))
	{
		lexemeBegin = 0;
		
		while(input[lexemeBegin]!='\0'&&input[lexemeBegin]!='\n' &&input[lexemeBegin]!='\r')  //while end of line is not found
		{
			while(input[lexemeBegin]==' ' || input[lexemeBegin] == '\t')
				lexemeBegin++;
						
			//checking for keywords and identifiers
			t = identifier_keyword(input);
			if(t.tokenID!=NOTOK)
			{
				write_token(t);
				continue;
			}
			
			//checking for integer constants
			t = integer_constant(input);
			if(t.tokenID!=NOTOK)
			{
				write_token(t);
				continue;
			}
			
			//checking for floating point number constants
			t = float_constant(input);
			if(t.tokenID!=NOTOK)
			{
				write_token(t);
				continue;
			}

			//checking for arithmetic operators
			t = arithmetic_operator(input);
			if(t.tokenID!=NOTOK)
			{
				write_token(t);
				continue;
			}

			//checking for assignment operators
			t = assignment_operator(input);
			if(t.tokenID!=NOTOK)
			{
				write_token(t);
				continue;
			}

			//checking for relational operators
			t = relational_operator(input);
			if(t.tokenID!=NOTOK)
			{
				write_token(t);
				continue;
			}

			//checking for special symbols
			t = special_symbol(input);
			if(t.tokenID!=NOTOK)
			{
				write_token(t);
				continue;
			}
			
			//checking for comments
			comment(input);
			//checking erroneous lexeme
			error_condition(input);
		}
	}	
}
Beispiel #7
0
void standard_container::stop() { stop(error_condition()); }
Beispiel #8
0
void container::stop() { stop(error_condition()); }
Beispiel #9
0
 inline error_condition make_error_condition(fibio::fibers::future_errc e) //noexcept
 {
     return error_condition(underlying_cast<int>(e), fibio::fibers::future_category());
 }