OSDN Git Service

実装したはずなんだが、何故かエラー…
authorMyun2 <myun2@nwhite.info>
Sun, 13 May 2012 18:41:09 +0000 (03:41 +0900)
committerMyun2 <myun2@nwhite.info>
Sun, 13 May 2012 18:41:09 +0000 (03:41 +0900)
roast/include/roast/windows/socket.hpp
roast/include/roast/windows/socket_sub.hpp

index 05ad3f6..e71c83e 100644 (file)
@@ -30,11 +30,14 @@ namespace roast
                        int m_af;
                        int m_socket_type;
                        int m_socket_protocol;
+                       socket_cleanup m_cleanup;
 
                public:
                        socket(int af=AF_INET, int type=SOCK_STREAM, int protocol=0)
                                : m_sock(NULL)
                        {
+                               m_cleanup.add();
+
                                m_af = af;
                                m_socket_type = type;
                                m_socket_protocol = protocol;
@@ -47,6 +50,7 @@ namespace roast
                                        throw socket_exception(::WSAGetLastError(), "roast::socket::socket() m_sock is INVALID_SOCKET.");
                        }
                        virtual ~socket(){
+                               m_cleanup.del();
                                close();
                        }
 
index 01e60c1..e95bd12 100644 (file)
@@ -50,7 +50,7 @@ namespace roast
                                m_count++;
                        }
                        
-                       static void free()
+                       static void del()
                        {
                                m_count--;
                                if ( m_count == 0 )
@@ -62,6 +62,8 @@ namespace roast
                        static const ::WSADATA& get_wsadata(){ return m_wsaInfo; }
                };
                
+               //      Static Variables
+               ::WSADATA socket_cleanup::m_wsaInfo;
                int socket_cleanup::m_count = 0;
        }
 }