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:
phamt 2010-08-05 18:49:04 +00:00
parent a5884abf18
commit 3927eb8bf1

View File

@ -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);