29 #ifndef RGJ_FREE_SOCKET_H_
30 #define RGJ_FREE_SOCKET_H_
32 #include <skstream/skstreamconfig.h>
36 static const int SOCKET_ERROR = -1;
40 #ifndef INVALID_SOCKET
41 #define INVALID_SOCKET (SOCKET_TYPE)~0
42 #endif // INVALID_SOCKET
46 #warning System headers do not define INADDR_NONE
47 #define INADDR_NONE 0xFFFFFFFF
54 namespace FreeSockets {
56 proto_IP = IPPROTO_IP,
57 proto_ICMP = IPPROTO_ICMP,
59 proto_IGMP = IPPROTO_IGMP,
61 proto_IGMP = IPPROTO_GGP,
63 proto_TCP = IPPROTO_TCP,
64 proto_PUP = IPPROTO_PUP,
65 proto_UDP = IPPROTO_UDP,
66 proto_IDP = IPPROTO_IDP,
68 proto_SCTP = IPPROTO_SCTP,
70 proto_RAW = IPPROTO_RAW
81 static int startup_count;
83 mutable int LastError;
85 void setLastError()
const;
91 virtual SOCKET_TYPE getSocket()
const = 0;
93 int getLastError()
const {
98 LastError = other.getLastError();
101 bool is_open()
const {
102 return (getSocket() != INVALID_SOCKET);
105 static bool startup();
109 #endif // RGJ_FREE_SOCKET_H_
Base class for anything that encapsulates a socket.
Definition: sksocket.h:79