From 47b708f076b0f65722db195786a1755fbc0c1b17 Mon Sep 17 00:00:00 2001 From: Myun2 Date: Mon, 21 May 2012 19:11:19 +0900 Subject: [PATCH] =?utf8?q?=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=98=E3=82=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- roast/include/roast/io/basic_io.hpp | 4 ++-- roast/include/roast/io/handle_manage.hpp | 5 ++--- roast/include/roast/io/socket/socket.hpp | 2 ++ 3 files changed, 6 insertions(+), 5 deletions(-) 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)); } -- 2.11.0