From b1e5a63b7f9230294abf3ab7abe538efabe28f5f Mon Sep 17 00:00:00 2001 From: Myun2 Date: Mon, 14 May 2012 22:12:57 +0900 Subject: [PATCH] =?utf8?q?windows/socket.hpp:=20owner=E6=A9=9F=E8=83=BD?= =?utf8?q?=E3=82=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- roast/include/roast/windows/socket.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/roast/include/roast/windows/socket.hpp b/roast/include/roast/windows/socket.hpp index d4918634..bbf45cda 100644 --- a/roast/include/roast/windows/socket.hpp +++ b/roast/include/roast/windows/socket.hpp @@ -29,6 +29,7 @@ namespace roast socket_cleanup m_cleanup; bool m_opened; + bool m_owner; ::SOCKET m_sock; int m_af; int m_socket_type; @@ -58,6 +59,7 @@ namespace roast { m_cleanup.add(); m_opened = true; + m_owner = false; if ( m_sock == INVALID_SOCKET ) throw socket_exception(::WSAGetLastError(), "roast::socket::socket() m_sock is INVALID_SOCKET."); @@ -67,6 +69,7 @@ namespace roast { m_cleanup.add(); m_opened = false; + m_owner = true; m_af = af; m_socket_type = type; @@ -205,6 +208,9 @@ namespace roast int send(const void* s, size_t size, int flag=0){return 0;} int recv(void* s, size_t size, int flag=0){return 0;} + + void set_owner(){ m_owner = true; } + void deprive(){ m_owner = false; } }; ////////////////////////////////////////////////////////////////// -- 2.11.0