Definition at line 79 of file mainFileClient.cpp. References Impala::atol(), DoGet(), DoPut(), gChannel, Impala::Util::ChannelPool::Get(), Impala::CmdOptions::GetArg(), Impala::CmdOptions::GetInstance(), Impala::CmdOptions::GetInt(), Impala::CmdOptions::GetNrArg(), gVerbose, Impala::CmdOptions::Initialise(), Impala::Util::ChannelPool::Instance(), Impala::CmdOptions::ParseArgs(), and Impala::Util::Channel::Valid(). Referenced by main(). 00080 { 00081 CmdOptions& options = CmdOptions::GetInstance(); 00082 options.Initialise(false); 00083 String usageStr = "{put|get} servername port filename(s)\n\n"; 00084 if (! options.ParseArgs(argc, argv, usageStr, 4)) 00085 return 1; 00086 00087 String cmd = options.GetArg(0); 00088 String server = options.GetArg(1); 00089 int port = atol(options.GetArg(2)); 00090 00091 gVerbose = options.GetInt("verb"); 00092 00093 //gChannel = new Channel(server, port, gVerbose); 00094 gChannel = ChannelPool::Instance().Get(server, port, ".passwords"); 00095 if (!gChannel || !gChannel->Valid()) 00096 return 1; 00097 00098 if (cmd == "get") 00099 { 00100 for (int i=3 ; i<options.GetNrArg() ; i++) 00101 DoGet(options.GetArg(i)); 00102 } 00103 else if (cmd == "put") 00104 { 00105 for (int i=3 ; i<options.GetNrArg() ; i++) 00106 DoPut(options.GetArg(i)); 00107 } 00108 00109 // SK: Closing channels is handled by ChannelPool 00111 //gChannel->CloseChannel(); 00112 00113 return 0; 00114 }
Here is the call graph for this function:
|