OSDN Git Service

エラーじゃ
authorMyun2 <myun2@nwhite.info>
Mon, 21 May 2012 10:11:19 +0000 (19:11 +0900)
committerMyun2 <myun2@nwhite.info>
Mon, 21 May 2012 10:11:19 +0000 (19:11 +0900)
roast/include/roast/io/basic_io.hpp
roast/include/roast/io/handle_manage.hpp
roast/include/roast/io/socket/socket.hpp

index 5cdf4b1..4c5d3e8 100644 (file)
@@ -79,12 +79,12 @@ namespace roast
                void open(const open_params_type& params)
                {
                        if ( _Base::m_handle != _Impl::invalid_handle )
-                               throw io_exception("Already opened.");
+                               throw io_exception("roast::basic_io::open() Already opened.");
                        
                        _Base::m_handle = _Impl::open(params);
                        
                        if ( _Base::m_handle == _Impl::invalid_handle )
-                               throw io_exception("open(): open failed.");
+                               throw io_exception("roast::basic_io::open() open failed.");
                }
                
                //      Close
index 40b763c..6548ccd 100644 (file)
@@ -51,21 +51,20 @@ namespace roast
                handle_manage(handler_type handle) : m_handle(handle) {}
                
                virtual ~handle_manage(){
+                       /*      2012/05/18 myun2  Close by shared_handle.
                        close();
+                       */
                }
                
                /////////////////////////////////////////////////
                
                //      Close
                void close(){
-                       /*      2012/05/18 myun2  Close by shared_handle.
-                       
                        if ( m_handle != _Impl::invalid_handle )
                        {
                                _Impl::close(m_handle);
                                m_handle = _Impl::invalid_handle;
                        }
-                       */
                }
                
                ////////////////////////////////////////////////////
index d1fabc6..c32009c 100644 (file)
@@ -88,10 +88,12 @@ namespace roast
                
                void open(const char* host, int port)
                {
+                       close();
                        _Base::open(open_params_type(host, port));
                }
                void open(const char* host, int port, int family, int socktype, int protocol)
                {
+                       close();
                        _Base::open(open_params_type(host, port, family, socktype, protocol));
                }