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
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;
}
- */
}
////////////////////////////////////////////////////
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));
}