|
@@ -13,16 +13,23 @@
|
|
#include <sys/socket.h>
|
|
#include <sys/socket.h>
|
|
#include <resolv.h>
|
|
#include <resolv.h>
|
|
#endif
|
|
#endif
|
|
|
|
+#ifdef _WIN32
|
|
|
|
+#include <http.h>
|
|
|
|
+#endif
|
|
|
|
|
|
ls_std::Socket::Socket() : ls_std::Class("Socket")
|
|
ls_std::Socket::Socket() : ls_std::Class("Socket")
|
|
{}
|
|
{}
|
|
|
|
|
|
-bool ls_std::Socket::create(ls_std::AddressFamily _addressFamily, ls_std::SocketType _socketType, ls_std::NetworkProtocol _protocol)
|
|
|
|
|
|
+bool ls_std::Socket::create(ls_std::AddressFamily _addressFamily, ls_std::SocketType _socketType, ls_std::NetworkProtocol _networkProtocol)
|
|
{
|
|
{
|
|
bool created;
|
|
bool created;
|
|
|
|
|
|
#if defined(unix) || defined(__APPLE__)
|
|
#if defined(unix) || defined(__APPLE__)
|
|
- this->descriptor = ls_std::Socket::_create(_addressFamily, _socketType, _protocol);
|
|
|
|
|
|
+ this->descriptor = ls_std::Socket::_create(_addressFamily, _socketType, _networkProtocol);
|
|
|
|
+ created = this->descriptor >= 0;
|
|
|
|
+ #endif
|
|
|
|
+ #ifdef _WIN32
|
|
|
|
+ this->descriptor = ls_std::Socket::_create(_addressFamily, _socketType, _networkProtocol);
|
|
created = this->descriptor >= 0;
|
|
created = this->descriptor >= 0;
|
|
#endif
|
|
#endif
|
|
|
|
|
|
@@ -96,3 +103,14 @@ int ls_std::Socket::_convertSocketType(ls_std::SocketType _socketType)
|
|
return socket(addressFamily, socketType, networkProtocol);
|
|
return socket(addressFamily, socketType, networkProtocol);
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
+
|
|
|
|
+#ifdef _WIN32
|
|
|
|
+ SOCKET ls_std::Socket::_create(ls_std::AddressFamily _addressFamily, ls_std::SocketType _socketType, ls_std::NetworkProtocol _networkProtocol)
|
|
|
|
+ {
|
|
|
|
+ int addressFamily = ls_std::Socket::_convertAddressFamily(_addressFamily);
|
|
|
|
+ int socketType = ls_std::Socket::_convertSocketType(_socketType);
|
|
|
|
+ int networkProtocol = ls_std::Socket::_convertNetworkProtocol(_networkProtocol);
|
|
|
|
+
|
|
|
|
+ return socket(addressFamily, socketType, networkProtocol);
|
|
|
|
+ }
|
|
|
|
+#endif
|