PosixSocket.cpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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-25
  7. *
  8. * */
  9. #include <ls_std/common/api/socket/PosixSocket.hpp>
  10. #include <sys/socket.h>
  11. #include <unistd.h>
  12. int ls::std::common::api::PosixSocket::accept(int _socketFileDescriptor, struct sockaddr *_address, socklen_t* _addressLength)
  13. {
  14. return ::accept(_socketFileDescriptor, _address, _addressLength);
  15. }
  16. int ls::std::common::api::PosixSocket::bind(int _socketFileDescriptor, const struct sockaddr *_address, socklen_t _addressLength)
  17. {
  18. return ::bind(_socketFileDescriptor, _address, _addressLength);
  19. }
  20. int ls::std::common::api::PosixSocket::close(int _socketFileDescriptor)
  21. {
  22. return ::close(_socketFileDescriptor);
  23. }
  24. int ls::std::common::api::PosixSocket::connect(int _socketFileDescriptor, const struct sockaddr *_address, socklen_t _addressLength)
  25. {
  26. return ::connect(_socketFileDescriptor, _address, _addressLength);
  27. }
  28. int ls::std::common::api::PosixSocket::create(int _domain, int _type, int _protocol)
  29. {
  30. return ::socket(_domain, _type, _protocol);
  31. }
  32. int ls::std::common::api::PosixSocket::listen(int _socketFileDescriptor, int _backlog)
  33. {
  34. return ::listen(_socketFileDescriptor, _backlog);
  35. }