GPWNetwork.h 727 B

1234567891011121314151617181920212223242526272829303132333435
  1. /* GPWNetwork.h/Open GoPro, Version 2.0 (C) Copyright 2021 GoPro, Inc. (http://gopro.com/OpenGoPro). */
  2. /* This copyright was auto-generated on Sat Mar 5 01:05:53 UTC 2022 */
  3. #pragma once
  4. #include <WinSock2.h>
  5. #include <WS2tcpip.h>
  6. #include <system_error>
  7. #include <string>
  8. #include <iostream>
  9. class WSASession
  10. {
  11. public:
  12. WSASession();
  13. virtual ~WSASession();
  14. private:
  15. WSAData data;
  16. };
  17. class UDPSocket
  18. {
  19. public:
  20. UDPSocket();
  21. virtual ~UDPSocket();
  22. void SendTo(const std::string& address, unsigned short port, const char* buffer, int len, int flags = 0);
  23. sockaddr_in RecvFrom(char* buffer, int len, int& received, int flags = 0);
  24. void Bind(unsigned short port);
  25. private:
  26. SOCKET sock;
  27. };