00001
00002
00003
00004
00005
00006
00007 #include <iostream>
00008 #include <string>
00009 #include <cstdlib>
00010 #include "ComPlusPlus/ComPlusPlus"
00011
00012 int main (int argc, char *argv [] ) {
00013
00014 int port;
00015 std::string host = "127.0.0.1";
00016
00017 if ( argc >= 2 )
00018 port = atoi ( argv [ 1 ] );
00019 else
00020 port = 5678 ;
00021
00022 if ( argc >= 3 )
00023 host = argv [2 ];
00024
00025 int tries =1;
00026
00027 if ( argc == 4 )
00028 tries = atoi( argv [3 ]);
00029
00030 try {
00031 compp::SClnt C( host, port) ;
00032
00033 std::string ret ="";
00034 for ( int i=0; i < tries ; ++ i ) {
00035 ret = C.requestTransaction ( "Heya", true);
00036 }
00037 std::cout << "Received (cypered) " << ret << "\n";
00038
00039 for ( int i=0; i < tries ; ++ i ) {
00040 ret = C.requestTransaction ( "Heya", false );
00041 }
00042 std::cout << "Received (plain) " << ret << "\n";
00043
00044
00045 } catch ( syspp::ComException &e) {
00046 std::cout << "Exception " << e.what() << "\n";
00047 }
00048
00049
00050 return 0;
00051 }