IPosixSocket.hpp 1001 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2022-12-09
  6. * Changed: 2022-12-23
  7. *
  8. * */
  9. #ifndef LS_STD_I_POSIX_SOCKET_HPP
  10. #define LS_STD_I_POSIX_SOCKET_HPP
  11. #include <sys/socket.h>
  12. namespace ls::std::core::interface_type
  13. {
  14. class IPosixSocket
  15. {
  16. public:
  17. IPosixSocket();
  18. virtual ~IPosixSocket();
  19. virtual int accept(int _socketFileDescriptor, struct sockaddr *_address, socklen_t* _addressLength) = 0;
  20. virtual int bind(int _socketFileDescriptor, const struct sockaddr* _address, socklen_t _addressLength) = 0;
  21. virtual int close(int _socketFileDescriptor) = 0;
  22. virtual int connect(int _socketFileDescriptor, const struct sockaddr* _address, socklen_t _addressLength) = 0;
  23. virtual int create(int _domain, int _type, int _protocol) = 0; // constructor
  24. virtual int listen(int _socketFileDescriptor, int _backlog) = 0;
  25. };
  26. }
  27. #endif