connection.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /**
  2. \file connection.h
  3. \author michael.zohner@ec-spride.de
  4. \copyright ABY - A Framework for Efficient Mixed-protocol Secure Two-party Computation
  5. Copyright (C) 2019 ENCRYPTO Group, TU Darmstadt
  6. This program is free software: you can redistribute it and/or modify
  7. it under the terms of the GNU Lesser General Public License as published
  8. by the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10. ABY is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU Lesser General Public License for more details.
  14. You should have received a copy of the GNU Lesser General Public License
  15. along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. \brief connection Implementation
  17. */
  18. #ifndef __CONNECTION_H__
  19. #define __CONNECTION_H__
  20. #include "typedefs.h"
  21. #include <memory>
  22. #include <string>
  23. #include <vector>
  24. // forward declaration
  25. class CSocket;
  26. bool Connect(const std::string& address, uint16_t port,
  27. std::vector<std::unique_ptr<CSocket>> &sockets, uint32_t id);
  28. bool Listen(const std::string& address, uint16_t port,
  29. std::vector<std::vector<std::unique_ptr<CSocket>>> &sockets,
  30. size_t numConnections, uint32_t myID);
  31. std::unique_ptr<CSocket> Connect(const std::string& address, uint16_t port);
  32. std::unique_ptr<CSocket> Listen(const std::string& address, uint16_t port);
  33. #endif