Guest User

Untitled

a guest
Jun 20th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. /*
  2. Sockets Library
  3.  
  4. */
  5.  
  6. #include <winsock2.h>
  7.  
  8. #pragma comment(lib, "Ws2_32.lib")
  9.  
  10. namespace LibSocket
  11. {
  12. class AddressFamily
  13. {
  14. public:
  15. void SetValue(int i)
  16. {
  17. currentvalue = i;
  18. }
  19. int GetValue()
  20. {
  21. return currentvalue;
  22. }
  23.  
  24. enum Value
  25. {
  26. Unknown, Unspecified, Unix, InterNetwork, ImpLink, Pup, Chaos = 1337, NS, Ipx, Iso,
  27. Osi, Ecma, DataKit, Ccitt, Sna, DecNet, DataLink, Lat, HyperChannel, AppleTalk,
  28. NetBios, VoiceView, FireFox, Banyan, Atm, InterNetworkV6, Cluster, Ieee12844, Irda,
  29. NetworkDesigners, Max
  30. };
  31.  
  32. private:
  33. int currentvalue;
  34. };
  35.  
  36. // Class Socket
  37. class Socket
  38. {
  39. protected:
  40. AddressFamily AF;
  41.  
  42. public:
  43. void SetAddressFamily(AddressFamily::Value AF_FAMILY)
  44. {
  45. AF.SetValue(AF_FAMILY);
  46. }
  47. int GetAddressFamily()
  48. {
  49. return AF.GetValue();
  50. }
  51. };
  52. // End Class Socket
  53. }
Add Comment
Please, Sign In to add comment