您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ startCommand函数代码示例

51自学网 2021-06-03 08:21:35
  C++
这篇教程C++ startCommand函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中startCommand函数的典型用法代码示例。如果您正苦于以下问题:C++ startCommand函数的具体用法?C++ startCommand怎么用?C++ startCommand使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了startCommand函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: startCommand

void Connection::commandReady(Command *command) {  m_queuedCommand = command;  if (m_page->isLoading())    m_commandWaiting = true;  else    startCommand();}
开发者ID:beatspace9,项目名称:capybara-webkit,代码行数:7,


示例2: RegCreateKey

void WinConsole::SavePrefs(){	DWORD val;	HKEY hKey;	RegCreateKey(HKEY_CURRENT_USER, "Software//NZBGet", &hKey);	val = m_showTrayIcon;	RegSetValueEx(hKey, "ShowTrayIcon", 0, REG_DWORD, (BYTE*)&val, sizeof(val));	val = m_showConsole;	RegSetValueEx(hKey, "ShowConsole", 0, REG_DWORD, (BYTE*)&val, sizeof(val));	val = m_showWebUI;	RegSetValueEx(hKey, "ShowWebUI", 0, REG_DWORD, (BYTE*)&val, sizeof(val));	val = m_doubleClick;	RegSetValueEx(hKey, "TrayDoubleClick", 0, REG_DWORD, (BYTE*)&val, sizeof(val));	RegCloseKey(hKey);	// Autostart-setting	RegCreateKey(HKEY_CURRENT_USER, "Software//Microsoft//Windows//CurrentVersion//Run", &hKey);	if (m_autostart)	{		char filename[MAX_PATH + 1];		GetModuleFileName(nullptr, filename, sizeof(filename));		BString<1024> startCommand("/"%s/" -s -app -auto", filename);		RegSetValueEx(hKey, "NZBGet", 0, REG_SZ, (BYTE*)(char*)startCommand, strlen(startCommand) + 1);	}	else	{		RegDeleteValue(hKey, "NZBGet");	}	RegCloseKey(hKey);}
开发者ID:sanderjo,项目名称:nzbget,代码行数:35,


示例3: UpdateData

boolDCCollector::initiateTCPUpdate( int cmd, ClassAd* ad1, ClassAd* ad2, bool nonblocking ){	if( update_rsock ) {		delete update_rsock;		update_rsock = NULL;	}	if(nonblocking) {		UpdateData *ud = new UpdateData(cmd, Sock::reli_sock, ad1, ad2, this);			// Note that UpdateData automatically adds itself to the pending_update_list.		if (this->pending_update_list.size() == 1)		{			startCommand_nonblocking(cmd, Sock::reli_sock, 20, NULL, UpdateData::startUpdateCallback, ud );		}		return true;	}	Sock *sock = startCommand(cmd, Sock::reli_sock, 20);	if(!sock) {		newError( CA_COMMUNICATION_ERROR,				  "Failed to send TCP update command to collector" );		dprintf(D_ALWAYS,"Failed to send update to %s./n",idStr());		return false;	}	update_rsock = (ReliSock *)sock;	return finishUpdate( this, update_rsock, ad1, ad2 );}
开发者ID:AlainRoy,项目名称:htcondor,代码行数:26,


示例4: startCommand

bool attackDeauth::start(const QString &BSSID, QString MAC){    if (this->isRunning())        this->stop();    if (!utils::validMAC(BSSID)){        utils::mostrarError("Invalid BSSID");        this->stop();        return false;    }    if (!MAC.isEmpty()) {        if (!utils::validMAC(BSSID)){                utils::mostrarError("Invalid MAC DESTINATION");                this->stop();                return false;        }        else            MAC = " -c " + MAC; //add flag to mac    }    const QString command = AIREPLAY_COM + " -0 10 -a " +            BSSID + MAC + " " + GLOBALS::INTERFACE;    return startCommand(command);}
开发者ID:E-Soulja,项目名称:aircrackgui-m4,代码行数:28,


示例5: setAutoScroll

void setAutoScroll(unsigned char on) {	startCommand();	if(on){		sendByte(GLK12232_AUTO_SCROLL_ON);	} else {		sendByte(GLK12232_AUTO_SCROLL_OFF);	}}
开发者ID:nickveys,项目名称:mr-baybus-3,代码行数:8,


示例6: setAutoTransmitKeypresses

void setAutoTransmitKeypresses(unsigned char on) {	startCommand();	if(on){		sendByte(GLK12232_AUTO_TRANSMIT_KEYS_ON);	} else {		sendByte(GLK12232_AUTO_TRANSMIT_KEYS_OFF);	}}
开发者ID:nickveys,项目名称:mr-baybus-3,代码行数:8,


示例7: drawLine

void drawLine(unsigned char x1, unsigned char y1,				unsigned char x2, unsigned char y2) {	startCommand();	sendByte(GLK12232_DRAW_LINE);	sendByte(x1);	sendByte(y1);	sendByte(x2);	sendByte(y2);}
开发者ID:nickveys,项目名称:mr-baybus-3,代码行数:9,


示例8: setAutoRepeat

void setAutoRepeat(unsigned char on, unsigned char mode) {	startCommand();	if(on){		sendByte(GLK12232_AUTO_REPEAT_ON);		sendByte(mode);	} else {		sendByte(GLK12232_AUTO_REPEAT_OFF);	}}
开发者ID:nickveys,项目名称:mr-baybus-3,代码行数:9,


示例9: drawSolidRectangle

void drawSolidRectangle(unsigned char color, unsigned char x1, unsigned char y1,						unsigned char x2, unsigned char y2) {	startCommand();	sendByte(GLK12232_DRAW_SOLID_RECT);	sendByte(x1);	sendByte(y1);	sendByte(x2);	sendByte(y2);}
开发者ID:nickveys,项目名称:mr-baybus-3,代码行数:9,


示例10: drawOutlineRectangle

void drawOutlineRectangle(unsigned char color, unsigned char x1, unsigned char y1,							unsigned char x2, unsigned char y2) {	startCommand();	sendByte(GLK12232_DRAW_OUTLINE_RECT);	sendByte(x1);	sendByte(y1);	sendByte(x2);	sendByte(y2);}
开发者ID:nickveys,项目名称:mr-baybus-3,代码行数:9,


示例11: setCmdStr

bool DCStartd::_suspendClaim( ){	setCmdStr( "suspendClaim" );		if( ! checkClaimId() ) {		return false;	}	if( ! checkAddr() ) {		return false;	}	// if this claim is associated with a security session	ClaimIdParser cidp(claim_id);	char const *sec_session = cidp.secSessionId();		if (IsDebugLevel(D_COMMAND)) {		int cmd = SUSPEND_CLAIM;		dprintf (D_COMMAND, "DCStartd::_suspendClaim(%s,...) making connection to %s/n", getCommandStringSafe(cmd), _addr ? _addr : "NULL");	}	bool  result;	ReliSock reli_sock;	reli_sock.timeout(20);   // years of research... :)	if( ! reli_sock.connect(_addr) ) {		std::string err = "DCStartd::_suspendClaim: ";		err += "Failed to connect to startd (";		err += _addr ? _addr : "NULL";		err += ')';		newError( CA_CONNECT_FAILED, err.c_str() );		return false;	}	int cmd = SUSPEND_CLAIM;	result = startCommand( cmd, (Sock*)&reli_sock, 20, NULL, NULL, false, sec_session ); 	if( ! result ) {		newError( CA_COMMUNICATION_ERROR,				  "DCStartd::_suspendClaim: Failed to send command " );		return false;	}		// Now, send the ClaimId	if( ! reli_sock.put_secret(claim_id) ) {		newError( CA_COMMUNICATION_ERROR,				  "DCStartd::_suspendClaim: Failed to send ClaimId to the startd" );		return false;	}	if( ! reli_sock.end_of_message() ) {		newError( CA_COMMUNICATION_ERROR,				  "DCStartd::_suspendClaim: Failed to send EOM to the startd" );		return false;	}		return true;}
开发者ID:zzxuanyuan,项目名称:htcondor,代码行数:57,


示例12: startCommand

boolDCStartd::drainJobs(int how_fast,bool resume_on_completion,char const *check_expr,char const *start_expr,std::string &request_id){	std::string error_msg;	ClassAd request_ad;	Sock *sock = startCommand( DRAIN_JOBS, Sock::reli_sock, 20 );	if( !sock ) {		formatstr(error_msg,"Failed to start DRAIN_JOBS command to %s",name());		newError(CA_FAILURE,error_msg.c_str());		return false;	}	request_ad.Assign(ATTR_HOW_FAST,how_fast);	request_ad.Assign(ATTR_RESUME_ON_COMPLETION,resume_on_completion);	if( check_expr ) {		request_ad.AssignExpr(ATTR_CHECK_EXPR,check_expr);	}	if( start_expr ) {		request_ad.AssignExpr(ATTR_START_EXPR,start_expr);	}	if( !putClassAd(sock, request_ad) || !sock->end_of_message() ) {		formatstr(error_msg,"Failed to compose DRAIN_JOBS request to %s",name());		newError(CA_FAILURE,error_msg.c_str());		delete sock;		return false;	}	sock->decode();	ClassAd response_ad;	if( !getClassAd(sock, response_ad) || !sock->end_of_message() ) {		formatstr(error_msg,"Failed to get response to DRAIN_JOBS request to %s",name());		newError(CA_FAILURE,error_msg.c_str());		delete sock;		return false;	}	response_ad.LookupString(ATTR_REQUEST_ID,request_id);	bool result = false;	int error_code = 0;	response_ad.LookupBool(ATTR_RESULT,result);	if( !result ) {		std::string remote_error_msg;		response_ad.LookupString(ATTR_ERROR_STRING,remote_error_msg);		response_ad.LookupInteger(ATTR_ERROR_CODE,error_code);		formatstr(error_msg,				"Received failure from %s in response to DRAIN_JOBS request: error code %d: %s",				name(),error_code,remote_error_msg.c_str());		newError(CA_FAILURE,error_msg.c_str());		delete sock;		return false;	}	delete sock;	return true;}
开发者ID:zzxuanyuan,项目名称:htcondor,代码行数:57,


示例13: startCommand

void Connection::commandReady(QString commandName, QStringList arguments) {  m_commandName = commandName;  m_arguments = arguments;  if (m_page->isLoading())    m_commandWaiting = true;  else    startCommand();}
开发者ID:TooTallNate,项目名称:node-webkit-server,代码行数:9,


示例14: command

// when a transferd registers itself, it identifies who it is. The connection// is then held open and the schedd periodically might send more transfer// requests to the transferd. Also, if the transferd dies, the schedd is // informed quickly and reliably due to the closed connection.boolDCTransferD::setup_treq_channel(ReliSock **treq_sock_ptr, 	int timeout, CondorError *errstack) {	ReliSock *rsock;	if (treq_sock_ptr != NULL) {		// Our caller wants a pointer to the socket we used to succesfully		// register the claim. The NULL pointer will represent failure and		// this will only be set to something real if everything was ok.		*treq_sock_ptr = NULL;	}		/////////////////////////////////////////////////////////////////////////	// Connect to the transfer daemon	/////////////////////////////////////////////////////////////////////////	// This call with automatically connect to _addr, which was set in the	// constructor of this object to be the transferd in question.	rsock = (ReliSock*)startCommand(TRANSFERD_CONTROL_CHANNEL,		Stream::reli_sock, timeout, errstack);	if( ! rsock ) {		dprintf( D_ALWAYS, "DCTransferD::setup_treq_channel: "				 "Failed to send command (TRANSFERD_CONTROL_CHANNEL) "				 "to the schedd/n" );		errstack->push("DC_TRANSFERD", 1, 			"Failed to start a TRANSFERD_CONTROL_CHANNEL command.");		return false;	}	/////////////////////////////////////////////////////////////////////////	// Make sure we are authenticated.	/////////////////////////////////////////////////////////////////////////		// First, if we're not already authenticated, force that now. 	if (!forceAuthentication( rsock, errstack )) {		dprintf( D_ALWAYS, "DCTransferD::setup_treq_channel() authentication "				"failure: %s/n", errstack->getFullText().c_str() );		errstack->push("DC_TRANSFERD", 1, 			"Failed to authenticate properly.");		return false;	}	rsock->encode();	/////////////////////////////////////////////////////////////////////////	// At this point, the socket passed all of the authentication protocols	// so it is ready for use.	/////////////////////////////////////////////////////////////////////////	if (treq_sock_ptr)		*treq_sock_ptr = rsock;	return true;}
开发者ID:emaste,项目名称:htcondor,代码行数:61,


示例15: dprintf

boolDCShadow::getUserCredential( const char* user, const char* domain, MyString& credential){	ReliSock reli_sock;	bool  result;		// For now, if we have to ensure that the update gets		// there, we use a ReliSock (TCP).	reli_sock.timeout(20);   // years of research... :)	if( ! reli_sock.connect(_addr) ) {		dprintf( D_ALWAYS, "getUserCredential: Failed to connect to shadow "				 "(%s)/n", _addr );		return false;	}	result = startCommand( CREDD_GET_PASSWD, (Sock*)&reli_sock );	if( ! result ) {		dprintf( D_FULLDEBUG,				 "Failed to send CREDD_GET_PASSWD command to shadow/n" );		return false;	}	// Enable encryption if available. If it's not available, our peer	// will close the connection.	reli_sock.set_crypto_mode(true);	MyString senduser = user;	MyString senddomain = domain;	MyString recvcredential;	if(!reli_sock.code(senduser)) {		dprintf( D_FULLDEBUG, "Failed to send user (%s) to shadow/n", senduser.c_str() );		return false;	}	if(!reli_sock.code(senddomain)) {		dprintf( D_FULLDEBUG, "Failed to send domain (%s) to shadow/n", senddomain.c_str() );		return false;	}	if(!reli_sock.end_of_message()) {		dprintf( D_FULLDEBUG, "Failed to send EOM to shadow/n" );		return false;	}	reli_sock.decode();	if(!reli_sock.code(recvcredential)) {		dprintf( D_FULLDEBUG, "Failed to receive credential from shadow/n");		return false;	}	if(!reli_sock.end_of_message()) {		dprintf( D_FULLDEBUG, "Failed to receive EOM from shadow/n");		return false;	}	credential = recvcredential;	return true;}
开发者ID:bbockelm,项目名称:htcondor,代码行数:56,


示例16: ASSERT

void DCMessenger::startCommandAfterDelay_alarm(){	QueuedCommand *qc = (QueuedCommand *)daemonCore->GetDataPtr();	ASSERT(qc);	startCommand(qc->msg);	delete qc;	decRefCount();}
开发者ID:AlainRoy,项目名称:htcondor,代码行数:10,


示例17: setFontMetrics

void setFontMetrics(unsigned char leftMargin, unsigned char topMargin,					unsigned char xSpc, unsigned char ySpc, unsigned char scrollRow) {	startCommand();	sendByte(GLK12232_SET_FONT_METRICS);	sendByte(leftMargin);	sendByte(topMargin);	sendByte(xSpc);	sendByte(ySpc);	sendByte(scrollRow);}
开发者ID:nickveys,项目名称:mr-baybus-3,代码行数:10,


示例18: startCommand

void SHT1x::reset() {	// Wait for sensor sleep state	delayTimer.mDelay(11);	startCommand();	sendByte(CMD_SOFT_RESET);	// Wait for sensor sleep state	delayTimer.mDelay(11);}
开发者ID:vladamatena,项目名称:CDEECO,代码行数:10,


示例19: initBarGraph

void initBarGraph(unsigned char num, unsigned char type,					unsigned char x1, unsigned char y1,					unsigned char x2, unsigned char y2) {	startCommand();	sendByte(GLK12232_INIT_BAR_GRAPH);	sendByte(num);	sendByte(type);	sendByte(x1);	sendByte(y1);	sendByte(x2);	sendByte(y2);}
开发者ID:nickveys,项目名称:mr-baybus-3,代码行数:12,


示例20: dprintf

boolDCStarter::createJobOwnerSecSession(int timeout,char const *job_claim_id,char const *starter_sec_session,char const *session_info,MyString &owner_claim_id,MyString &error_msg,MyString &starter_version,MyString &starter_addr){	ReliSock sock;	if (IsDebugLevel(D_COMMAND)) {		dprintf (D_COMMAND, "DCStarter::createJobOwnerSecSession(%s,...) making connection to %s/n",			getCommandStringSafe(CREATE_JOB_OWNER_SEC_SESSION), _addr ? _addr : "NULL");	}	if( !connectSock(&sock, timeout, NULL) ) {		error_msg = "Failed to connect to starter";		return false;	}	if( !startCommand(CREATE_JOB_OWNER_SEC_SESSION, &sock,timeout,NULL,NULL,false,starter_sec_session) ) {		error_msg = "Failed to send CREATE_JOB_OWNER_SEC_SESSION to starter";		return false;	}	ClassAd input;	input.Assign(ATTR_CLAIM_ID,job_claim_id);	input.Assign(ATTR_SESSION_INFO,session_info);	sock.encode();	if( !putClassAd(&sock, input) || !sock.end_of_message() ) {		error_msg = "Failed to compose CREATE_JOB_OWNER_SEC_SESSION to starter";		return false;	}	sock.decode();	ClassAd reply;	if( !getClassAd(&sock, reply) || !sock.end_of_message() ) {		error_msg = "Failed to get response to CREATE_JOB_OWNER_SEC_SESSION from starter";		return false;	}	bool success = false;	reply.LookupBool(ATTR_RESULT,success);	if( !success ) {		reply.LookupString(ATTR_ERROR_STRING,error_msg);		return false;	}	reply.LookupString(ATTR_CLAIM_ID,owner_claim_id);	reply.LookupString(ATTR_VERSION,starter_version);		// get the full starter address from the starter in case it contains		// extra CCB info that we don't already know about	reply.LookupString(ATTR_STARTER_IP_ADDR,starter_addr);	return true;}
开发者ID:bbockelm,项目名称:htcondor,代码行数:52,


示例21: dprintf

bool DCStartd::checkpointJob( const char* name_ckpt ){	dprintf( D_FULLDEBUG, "Entering DCStartd::checkpointJob(%s)/n",			 name_ckpt );	setCmdStr( "checkpointJob" );	if (IsDebugLevel(D_COMMAND)) {		int cmd = PCKPT_JOB;		dprintf (D_COMMAND, "DCStartd::checkpointJob(%s,...) making connection to %s/n", getCommandStringSafe(cmd), _addr ? _addr : "NULL");	}	bool  result;	ReliSock reli_sock;	reli_sock.timeout(20);   // years of research... :)	if( ! reli_sock.connect(_addr) ) {		std::string err = "DCStartd::checkpointJob: ";		err += "Failed to connect to startd (";		err += _addr ? _addr : "NULL";		err += ')';		newError( CA_CONNECT_FAILED, err.c_str() );		return false;	}	int cmd = PCKPT_JOB;	result = startCommand( cmd, (Sock*)&reli_sock ); 	if( ! result ) {		newError( CA_COMMUNICATION_ERROR,				  "DCStartd::checkpointJob: Failed to send command PCKPT_JOB to the startd" );		return false;	}		// Now, send the name	if( ! reli_sock.put(name_ckpt) ) {		newError( CA_COMMUNICATION_ERROR,				  "DCStartd::checkpointJob: Failed to send Name to the startd" );		return false;	}	if( ! reli_sock.end_of_message() ) {		newError( CA_COMMUNICATION_ERROR,				  "DCStartd::checkpointJob: Failed to send EOM to the startd" );		return false;	}		// we're done	dprintf( D_FULLDEBUG, "DCStartd::checkpointJob: "			 "successfully sent command/n" );	return true;}
开发者ID:zzxuanyuan,项目名称:htcondor,代码行数:50,


示例22: QString

void Connection::processArgument(const char *data) {  if (m_argumentsExpected == -1) {    m_argumentsExpected = QString(data).toInt();  } else if (m_expectingDataSize == -1) {    m_expectingDataSize = QString(data).toInt();  } else {    m_arguments.append(QString::fromUtf8(data));  }  if (m_arguments.length() == m_argumentsExpected) {    if (m_page->isLoading())      m_commandWaiting = true;    else      startCommand();  }}
开发者ID:nicholaides,项目名称:capybara-webkit,代码行数:16,


示例23: dprintf

bool DCStartd::checkpointJob( const char* name_ckpt ){	dprintf( D_FULLDEBUG, "Entering DCStartd::checkpointJob(%s)/n",			 name_ckpt );	setCmdStr( "checkpointJob" );	bool  result;	ReliSock reli_sock;	reli_sock.timeout(20);   // years of research... :)	if( ! reli_sock.connect(_addr) ) {		std::string err = "DCStartd::checkpointJob: ";		err += "Failed to connect to startd (";		err += _addr;		err += ')';		newError( CA_CONNECT_FAILED, err.c_str() );		return false;	}	int cmd = PCKPT_JOB;	result = startCommand( cmd, (Sock*)&reli_sock ); 	if( ! result ) {		newError( CA_COMMUNICATION_ERROR,				  "DCStartd::checkpointJob: Failed to send command PCKPT_JOB to the startd" );		return false;	}		// Now, send the name	if( ! reli_sock.code((unsigned char *)const_cast<char*>(name_ckpt)) ) {		newError( CA_COMMUNICATION_ERROR,				  "DCStartd::checkpointJob: Failed to send Name to the startd" );		return false;	}	if( ! reli_sock.end_of_message() ) {		newError( CA_COMMUNICATION_ERROR,				  "DCStartd::checkpointJob: Failed to send EOM to the startd" );		return false;	}		// we're done	dprintf( D_FULLDEBUG, "DCStartd::checkpointJob: "			 "successfully sent command/n" );	return true;}
开发者ID:AmesianX,项目名称:htcondor,代码行数:45,


示例24: dprintf

DCStarter::X509UpdateStatusDCStarter::delegateX509Proxy( const char * filename, time_t expiration_time, char const *sec_session_id, time_t *result_expiration_time){	ReliSock rsock;	rsock.timeout(60);	if( ! rsock.connect(_addr) ) {		dprintf(D_ALWAYS, "DCStarter::delegateX509Proxy: "			"Failed to connect to starter %s/n", _addr);		return XUS_Error;	}	CondorError errstack;	if( ! startCommand(DELEGATE_GSI_CRED_STARTER, &rsock, 0, &errstack, NULL, false, sec_session_id) ) {		dprintf( D_ALWAYS, "DCStarter::delegateX509Proxy: "				 "Failed send command to the starter: %s/n",				 errstack.getFullText().c_str());		return XUS_Error;	}		// Send the gsi proxy	filesize_t file_size = 0;	// will receive the size of the file	if ( rsock.put_x509_delegation(&file_size,filename,expiration_time,result_expiration_time) < 0 ) {		dprintf(D_ALWAYS,			"DCStarter::delegateX509Proxy "			"failed to delegate proxy file %s (size=%ld)/n",			filename, (long int)file_size);		return XUS_Error;	}		// Fetch the result	rsock.decode();	int reply = 0;	rsock.code(reply);	rsock.end_of_message();	switch(reply) {		case 0: return XUS_Error;		case 1: return XUS_Okay;		case 2: return XUS_Declined;	}	dprintf(D_ALWAYS, "DCStarter::delegateX509Proxy: "		"remote side returned unknown code %d. Treating "		"as an error./n", reply);	return XUS_Error;}
开发者ID:AlanDeSmet,项目名称:htcondor,代码行数:45,


示例25: ProgInstance

	integer ServiceApp::start(const Args & args)	{		StdError serr;				if (args.length() < 3) return onCommandLineError(args);		try {			appname = args[0];			String instanceName = args[1];			if (instanceName == defaultInstanceName)  instanceName = getDefaultInstanceName(appname);			StringA command = String::getUtf8(args[2]);;			instance = ProgInstance(instanceName);			Args rmargs(const_cast<ConstStrW *>(args.data()+3),args.length()-3);			stopCommand = false;			return startCommand(command,rmargs,serr);		} catch (...) {			return onStartError(serr);		}	}
开发者ID:ondra-novak,项目名称:lightspeed,代码行数:19,


示例26: dprintf

boolDCCollector::sendUDPUpdate( int cmd, ClassAd* ad1, ClassAd* ad2, bool nonblocking ){		// with UDP it's pretty straight forward.  We always want to		// use Daemon::startCommand() so we get all the security stuff		// in every update.  In fact, we want to recreate the SafeSock		// itself each time, since it doesn't seem to work if we reuse		// the SafeSock object from one update to the next...	dprintf( D_FULLDEBUG,			 "Attempting to send update via UDP to collector %s/n",			 update_destination );	bool raw_protocol = false;	if( cmd == UPDATE_COLLECTOR_AD || cmd == INVALIDATE_COLLECTOR_ADS ) {			// we *never* want to do security negotiation with the			// developer collector.		raw_protocol = true;	}	if(nonblocking) {		UpdateData *ud = new UpdateData(cmd, Sock::safe_sock, ad1, ad2, this);		if (this->pending_update_list.size() == 1)		{			startCommand_nonblocking(cmd, Sock::safe_sock, 20, NULL, UpdateData::startUpdateCallback, ud, NULL, raw_protocol );		}		return true;	}	Sock *ssock = startCommand(cmd, Sock::safe_sock, 20, NULL, NULL, raw_protocol);	if(!ssock) {		newError( CA_COMMUNICATION_ERROR,				  "Failed to send UDP update command to collector" );		return false;	}	bool success = finishUpdate( this, ssock, ad1, ad2 );	delete ssock;	return success;}
开发者ID:AlainRoy,项目名称:htcondor,代码行数:41,


示例27: reset

uint16_t SHT1x::readCommand(uint8_t command) {	reset();	// Send command	startCommand();	bool ok = sendByte(command);	if(!ok)		console.print(Error, "Error writing byte to sensor !!!");	// Wait for competition	delayTimer.mDelay(320);	// Receive result	union {		uint16_t value;		uint8_t bytes[2];	} result;	result.bytes[1] = receiveByte();	result.bytes[0] = receiveByte();	receiveByte();	return result.value;}
开发者ID:vladamatena,项目名称:CDEECO,代码行数:23,



注:本文中的startCommand函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ startDrag函数代码示例
C++ startAnimation函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。