IPosixSocket.hpp 989 B

1234567891011121314151617181920212223242526272829303132
  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-12
  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. virtual ~IPosixSocket() = default;
  18. virtual int accept(int _socketFileDescriptor, struct sockaddr *_address, socklen_t* _addressLength) = 0;
  19. virtual int bind(int _socketFileDescriptor, const struct sockaddr* _address, socklen_t _addressLength) = 0;
  20. virtual int close(int _socketFileDescriptor) = 0;
  21. virtual int connect(int _socketFileDescriptor, const struct sockaddr* _address, socklen_t _addressLength) = 0;
  22. virtual int create(int _domain, int _type, int _protocol) = 0; // constructor
  23. virtual int listen(int _socketFileDescriptor, int _backlog) = 0;
  24. };
  25. }
  26. #endif