Emerson R&S SGT100A User Manual page 590

Sgma vector rf source
Table of Contents

Advertisement

®
R&S
SGT100A
{
if( !clientIsConnected )
{
throw string("connection must be established before any data can be received\n");
}
char * receiveBuffer = new char[receiveBufferSize];
memset( receiveBuffer, 0, receiveBufferSize );
bool receiving = true;
while( receiving )
{
int receivedByteCount = recv( currentSocketDescr,
receiveBuffer, receiveBufferSize, 0 );
if( receivedByteCount < 0 )
{
}
rxString += string( receiveBuffer );
receiving = ( receivedByteCount == receiveBufferSize );
}
delete [] receiveBuffer;
}
string TcpClient::getCurrentHostName( ) const
{
return currentHostName;
}
int TcpClient::getCurrentPort( ) const
{
return currentPort;
}
TelnetClient.cpp
#include <iostream>
#include "TcpClient.h"
void printUsage()
{
cout<<"usage: EthernetRawCommand <server-ip> [scpi-command]"<<endl;
}
int main( int argc, char *argv[] )
{
int errorCode
bool useSingleCommand = false;
string singleCommand
string hostname
int
string input
TcpClient client;
switch( argc )
{
case 3:
User Manual 1176.8674.02 ─ 12
throw string("error while receiving data\n");
= 0; //no error
= "";
= "";
port
= 5025;
= "";
Telnet program examples
590

Advertisement

Table of Contents
loading

Table of Contents