fvserver.cpp 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*##############################################################################
  2. Copyright (C) 2011 HPCC Systems.
  3. All rights reserved. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU Affero General Public License as
  5. published by the Free Software Foundation, either version 3 of the
  6. License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Affero General Public License for more details.
  11. You should have received a copy of the GNU Affero General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. ############################################################################## */
  14. /*##############################################################################
  15. Copyright (C) 2011 HPCC Systems.
  16. All rights reserved. This program is free software: you can redistribute it and/or modify
  17. it under the terms of the GNU Affero General Public License as
  18. published by the Free Software Foundation, either version 3 of the
  19. License, or (at your option) any later version.
  20. This program is distributed in the hope that it will be useful,
  21. but WITHOUT ANY WARRANTY; without even the implied warranty of
  22. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  23. GNU Affero General Public License for more details.
  24. You should have received a copy of the GNU Affero General Public License
  25. along with this program. If not, see <http://www.gnu.org/licenses/>.
  26. ############################################################################## */
  27. #include <jliball.hpp>
  28. #include "daclient.hpp"
  29. #include "dadfs.hpp"
  30. #include "dasds.hpp"
  31. #include "dalienv.hpp"
  32. #include "fileview.hpp"
  33. #include "dllserver.hpp"
  34. Semaphore sem;
  35. bool myAbortHandler()
  36. {
  37. sem.signal();
  38. return false;
  39. }
  40. int main(int argc, const char *argv[])
  41. {
  42. InitModuleObjects();
  43. if (argc < 4 || argv[1][0]=='/' && argv[1][1]=='?')
  44. {
  45. printf("fvserver <dali-server> <queue> <cluster>");
  46. return 1;
  47. }
  48. Owned<IGroup> serverGroup = createIGroup(argv[1],DALI_SERVER_PORT);
  49. initClientProcess(serverGroup, DCR_Other, 9123, NULL, NULL, MP_WAIT_FOREVER);
  50. setPasswordsFromSDS();
  51. LocalAbortHandler localHandler(myAbortHandler);
  52. startRemoteDataSourceServer(argv[2], argv[3]);
  53. sem.wait();
  54. stopRemoteDataSourceServer();
  55. closeDllServer();
  56. closeEnvironment();
  57. closedownClientProcess();
  58. releaseAtoms();
  59. return 0;
  60. }