From: Myun2 Date: Mon, 21 May 2012 10:11:19 +0000 (+0900) Subject: エラーじゃ X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=47b708f076b0f65722db195786a1755fbc0c1b17;p=roast%2Froast.git エラーじゃ --- diff --git a/roast/include/roast/io/basic_io.hpp b/roast/include/roast/io/basic_io.hpp index 5cdf4b12..4c5d3e82 100644 --- a/roast/include/roast/io/basic_io.hpp +++ b/roast/include/roast/io/basic_io.hpp @@ -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 diff --git a/roast/include/roast/io/handle_manage.hpp b/roast/include/roast/io/handle_manage.hpp index 40b763c1..6548ccd1 100644 --- a/roast/include/roast/io/handle_manage.hpp +++ b/roast/include/roast/io/handle_manage.hpp @@ -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; } - */ } //////////////////////////////////////////////////// diff --git a/roast/include/roast/io/socket/socket.hpp b/roast/include/roast/io/socket/socket.hpp index d1fabc6e..c32009c5 100644 --- a/roast/include/roast/io/socket/socket.hpp +++ b/roast/include/roast/io/socket/socket.hpp @@ -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)); }