WinSocketSystem.h 289 B

1234567891011121314151617181920212223
  1. #pragma once
  2. #include <Winsock2.h>
  3. #pragma comment(lib,"ws2_32.lib")
  4. class WinSocketSystem
  5. {
  6. public:
  7. WinSocketSystem()
  8. {
  9. int iResult = WSAStartup(MAKEWORD(2, 2), &wsaData);
  10. if (iResult != NO_ERROR){
  11. }
  12. }
  13. ~WinSocketSystem()
  14. {
  15. WSACleanup();
  16. }
  17. protected:
  18. WSADATA wsaData;
  19. };