mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-31 19:32:31 +00:00 
			
		
		
		
	Setting xCAT resquest stream to be blocking because if a short request is made along with a long running request, the output of the long running request never returns.
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6989 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
		| @@ -48,15 +48,16 @@ function docmd($cmd, $nr, $args){ | ||||
| 	// Open socket to submit request | ||||
| 	$socket = new Net_Socket(); | ||||
| 	$socket->connect('ssl://localhost', 3001, true, 30); | ||||
| 	// Set socket as non-blocking stream | ||||
| 	$socket->setBlocking(false); | ||||
| 	// Send xCAT request | ||||
| 	$socket->write($request->asXML()); | ||||
| 	// Get xCAT response | ||||
| 	$xml = $socket->readAll(); | ||||
| 	// Close socker | ||||
| 	$socket->disconnect(); | ||||
| 	 | ||||
| 	$socket->setBlocking(true);		// Set socket as blocking stream | ||||
| 	$socket->write($request->asXML());	// Send xCAT request | ||||
| 	$xml = $socket->readAll();			// Get xCAT response | ||||
| 	$status = $socket->getStatus(); | ||||
| 	while ($status['unread_bytes']) { | ||||
| 		// Do nothing | ||||
| 		$status = $socket->getStatus(); | ||||
| 	} | ||||
| 	$socket->disconnect();	// Close socket | ||||
| 		 | ||||
| 	// submit_request() was the old way of sending the xCAT request | ||||
| 	// It is no longer needed | ||||
| 	// $xml = submit_request($request,0); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user