]> git.tdb.fi Git - libs/net.git/blobdiff - source/net/socket.h
Move most platform-specific code into overlay directories
[libs/net.git] / source / net / socket.h
index f97588415b1e5df052b1138a1e706f596810fc0b..1f60f9bb2276942ce31e7eaf69612e4e67641f02 100644 (file)
@@ -9,11 +9,6 @@
 namespace Msp {
 namespace Net {
 
-#ifdef WIN32
-typedef int socklen_t;
-#endif
-
-
 class bad_socket_state: public std::logic_error
 {
 public:
@@ -25,6 +20,14 @@ public:
 class Socket: public IO::EventObject
 {
 protected:
+       enum SocketEvent
+       {
+               S_NONE = IO::P_NONE,
+               S_INPUT = IO::P_INPUT,
+               S_CONNECT = 4096,
+               S_ACCEPT = 8192
+       };
+
        struct Private;
 
        Private *priv;
@@ -32,6 +35,9 @@ protected:
 
        Socket(const Private &);
        Socket(Family, int, int);
+private:
+       void platform_init();
+       void platform_cleanup();
 public:
        ~Socket();
 
@@ -46,8 +52,8 @@ public:
 
        void set_timeout(const Time::TimeDelta &);
 protected:
-       int set_option(int, int, const void *, socklen_t);
-       int get_option(int, int, void *, socklen_t *) const;
+       void set_socket_events(unsigned);
+       void set_platform_events(unsigned);
 };
 
 } // namespace Net