From af7018ed03e01ee1e8bb91070e0d6cdd27573bc9 Mon Sep 17 00:00:00 2001 From: Myun2 Date: Mon, 21 May 2012 19:08:24 +0900 Subject: [PATCH] =?utf8?q?=E3=81=93=E3=82=8C=E3=81=A7=E3=82=82=20Already?= =?utf8?q?=20Opended=20=E3=81=8B=E3=83=BB=E3=83=BB=E3=83=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- roast/include/roast/io/socket/socket.hpp | 13 ++++++++----- roast/include/roast/windows/socket_impl.hpp | 7 +++++++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/roast/include/roast/io/socket/socket.hpp b/roast/include/roast/io/socket/socket.hpp index 81c35d12..d1fabc6e 100644 --- a/roast/include/roast/io/socket/socket.hpp +++ b/roast/include/roast/io/socket/socket.hpp @@ -71,13 +71,16 @@ namespace roast //socket_(::FILE* fp) : _Base(fp){} socket_(const socket_& from) : _Base(from), m_openparam(from.m_openparam) {} socket_(const char* host, int port) /*: _Base(open_params_type(host, port))*/{ - create_socket(); - open(host, port); + //create_socket(); + //open(host, port); + open(open_params_type(host, port)); } socket_(const char* host, int port, int family, int socktype, int protocol) : - /*_Base(open_params_type(host, port, socktype, family))*/{ - create_socket(family, socktype, protocol); - open(host, port); + /*_Base(open_params_type(host, port, socktype, family))*/ + { + //create_socket(family, socktype, protocol); + //open(host, port); + open(open_params_type(host, port, family, socktype, protocol)); } virtual ~socket_(){} diff --git a/roast/include/roast/windows/socket_impl.hpp b/roast/include/roast/windows/socket_impl.hpp index d34ed8a4..cdda78d6 100644 --- a/roast/include/roast/windows/socket_impl.hpp +++ b/roast/include/roast/windows/socket_impl.hpp @@ -55,6 +55,13 @@ namespace roast type = type_in; protocol = protocol_in; } + open_params_type(const char* host_in, int port_in){ + host = host_in; + port = port_in; + af = AF_INET; + type = SOCK_STREAM; + protocol = protocol; + } }; struct ioctl_data {}; -- 2.11.0