Browse Source

Server.cpp fix

0.1
Pedro Berrocal 5 years ago
parent
commit
40ba084f1a
3 changed files with 16 additions and 13 deletions
  1. +16
    -13
      src/Server.cpp
  2. BIN
      src/Server.o
  3. BIN
      src/server

+ 16
- 13
src/Server.cpp View File

@ -7,31 +7,34 @@ using namespace Demo;
class PrinterI : public Printer
{
public:
virtual void printString(string s, const Ice::Current&) override;
virtual void printString(string s, const Ice::Current&) override;
};
void
PrinterI::printString(string s, const Ice::Current&)
{
cout << s << endl;
cout << s << endl;
}
int
main(int argc, char* argv[])
{
try
try
{
Ice::CommunicatorHolder ich(argc, argv);
auto adapter = ich->createObjectAdapterWithEndpoints("SimplePrinterAdapter", "default -p 10000");
auto servant = make_shared<PrinterI>();
adapter->add(servant, Ice::stringToIdentity("SimplePrinter"));
adapter->activate();
ich->waitForShutdown();
Ice::CommunicatorHolder ich(argc, argv);
auto adapter = ich->createObjectAdapterWithEndpoints("SimplePrinterAdapter", "ws -p 10000");
cout << "\n Test server for MW | pedro@defaultdrop.net " << endl;
auto servant = make_shared<PrinterI>();
adapter->add(servant, Ice::stringToIdentity("SimplePrinter"));
adapter->activate();
ich->waitForShutdown();
}
catch(const std::exception& e)
catch(const std::exception& e)
{
cerr << e.what() << endl;
return 1;
cerr << e.what() << endl;
return 1;
}
return 0;
return 0;
}

BIN
src/Server.o View File


BIN
src/server View File


Loading…
Cancel
Save