Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Sockets Library
- */
- #include <winsock2.h>
- #pragma comment(lib, "Ws2_32.lib")
- namespace LibSocket
- {
- class AddressFamily
- {
- public:
- void SetValue(int i)
- {
- currentvalue = i;
- }
- int GetValue()
- {
- return currentvalue;
- }
- enum Value
- {
- Unknown, Unspecified, Unix, InterNetwork, ImpLink, Pup, Chaos = 1337, NS, Ipx, Iso,
- Osi, Ecma, DataKit, Ccitt, Sna, DecNet, DataLink, Lat, HyperChannel, AppleTalk,
- NetBios, VoiceView, FireFox, Banyan, Atm, InterNetworkV6, Cluster, Ieee12844, Irda,
- NetworkDesigners, Max
- };
- private:
- int currentvalue;
- };
- // Class Socket
- class Socket
- {
- protected:
- AddressFamily AF;
- public:
- void SetAddressFamily(AddressFamily::Value AF_FAMILY)
- {
- AF.SetValue(AF_FAMILY);
- }
- int GetAddressFamily()
- {
- return AF.GetValue();
- }
- };
- // End Class Socket
- }
Add Comment
Please, Sign In to add comment