Remote Control Basics
R&S
®
SMU200A
467Operating Manual 1007.9845.32 ─ 15
{
case 3:
useSingleCommand = true;
singleCommand = argv[2];
case 2:
hostname = argv[1];
break;
default:
printUsage();
getchar();
return(-1);
}
try
{
#ifndef LINUX
WORD wVersionRequested = MAKEWORD( 2, 2 );
WSADATA wsaData;
int err = WSAStartup( wVersionRequested, &wsaData );
if ( err != 0 )
{
throw string ("Could not find a usable WinSock DLL.");
}
#endif
client.connectToServer( hostname, port );
bool terminate = false;
while( !terminate )
{
char buffer[1024];
if( useSingleCommand )
{
input = singleCommand; //send string
}
else
{
cout <<">";
cin.getline( buffer, 1024 );
input = buffer;
if( input == "end" )
{
terminate = true;
}
}
if( !terminate)
{
client.transmit( input ); //send string
int qPos = input.find( "?", 0 );
//receive string only when needed
if( qPos > 0 )
{
string rcStr = "";
Starting a Remote Control Session