OSDN Git Service

これでも Already Opended か・・・
authorMyun2 <myun2@nwhite.info>
Mon, 21 May 2012 10:08:24 +0000 (19:08 +0900)
committerMyun2 <myun2@nwhite.info>
Mon, 21 May 2012 10:08:24 +0000 (19:08 +0900)
roast/include/roast/io/socket/socket.hpp
roast/include/roast/windows/socket_impl.hpp

index 81c35d1..d1fabc6 100644 (file)
@@ -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_(){}
 
index d34ed8a..cdda78d 100644 (file)
@@ -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 {};