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