gSoap中啓動服務器端示例代碼

 

void my_server_soap_run()
{


	struct soap soap;
	soap_init(&soap);

	int port = 8090;

	int m = soap_bind(&soap, NULL, port, 100);//SOAP ,HOST,PORT,BACKLOG
	if (m < 0)
	{
		soap_print_fault(&soap, stderr);
		exit(-1);
	}

	int s;
	for ( ; ; )
	{ 
		s = soap_accept(&soap); 
		if (s < 0)
		{ 
			soap_print_fault(&soap, stderr);
			exit(-1);
		}

		soap_serve(&soap);//該句說明該server的服務
		soap_end(&soap);
	}


}


 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章