diff --git a/Jupiter/IRC_Client.cpp b/Jupiter/IRC_Client.cpp index 840eb4e..e453883 100644 --- a/Jupiter/IRC_Client.cpp +++ b/Jupiter/IRC_Client.cpp @@ -1269,7 +1269,7 @@ int Jupiter::IRC::Client::primaryHandler() bool Jupiter::IRC::Client::connect() { const Jupiter::ReadableString &clientAddress = Jupiter::IRC::Client::readConfigValue(STRING_LITERAL_AS_REFERENCE("ClientAddress")); - if (Jupiter::IRC::Client::data_->sock->connectToHost(Jupiter::IRC::Client::data_->serverHostname.c_str(), Jupiter::IRC::Client::data_->serverPort, clientAddress.size() == 0 ? nullptr : Jupiter::CStringS(clientAddress).c_str(), (unsigned short)Jupiter::IRC::Client::readConfigLong(STRING_LITERAL_AS_REFERENCE("ClientPort"))) == false) + if (Jupiter::IRC::Client::data_->sock->connect(Jupiter::IRC::Client::data_->serverHostname.c_str(), Jupiter::IRC::Client::data_->serverPort, clientAddress.size() == 0 ? nullptr : Jupiter::CStringS(clientAddress).c_str(), (unsigned short)Jupiter::IRC::Client::readConfigLong(STRING_LITERAL_AS_REFERENCE("ClientPort"))) == false) return false; Jupiter::IRC::Client::data_->sock->setBlocking(false); diff --git a/Jupiter/Jupiter.h b/Jupiter/Jupiter.h index 46ba2d5..2259922 100644 --- a/Jupiter/Jupiter.h +++ b/Jupiter/Jupiter.h @@ -35,7 +35,7 @@ #define JUPITER_API #endif // _WIN32 -#define JUPITER_VERSION "Jupiter 0.14" /** Version of this program at compile time. */ +#define JUPITER_VERSION "Jupiter 0.15" /** Version of this program at compile time. */ #if defined __cplusplus extern "C" diff --git a/Jupiter/SecureSocket.cpp b/Jupiter/SecureSocket.cpp index 38d3891..9051358 100644 --- a/Jupiter/SecureSocket.cpp +++ b/Jupiter/SecureSocket.cpp @@ -81,9 +81,9 @@ Jupiter::SecureSocket *Jupiter::SecureSocket::accept() return nullptr; } -bool Jupiter::SecureSocket::bindToPort(const char *hostname, unsigned short iPort, bool andListen) +bool Jupiter::SecureSocket::bind(const char *hostname, unsigned short iPort, bool andListen) { - return Jupiter::Socket::bindToPort(hostname, iPort, andListen); + return Jupiter::Socket::bind(hostname, iPort, andListen); } void Jupiter::SecureSocket::closeSocket() @@ -165,9 +165,9 @@ void Jupiter::SecureSocket::setCertificate(const Jupiter::ReadableString &pem) Jupiter::SecureSocket::setCertificate(pem, pem); } -bool Jupiter::SecureSocket::connectToHost(const char *hostname, unsigned short iPort, const char *clientAddress, unsigned short clientPort) +bool Jupiter::SecureSocket::connect(const char *hostname, unsigned short iPort, const char *clientAddress, unsigned short clientPort) { - return Jupiter::Socket::connectToHost(hostname, iPort, clientAddress, clientPort) && this->initSSL(); + return Jupiter::Socket::connect(hostname, iPort, clientAddress, clientPort) && this->initSSL(); } int Jupiter::SecureSocket::peek() diff --git a/Jupiter/SecureSocket.h b/Jupiter/SecureSocket.h index 1b70828..d65d5a3 100644 --- a/Jupiter/SecureSocket.h +++ b/Jupiter/SecureSocket.h @@ -1,5 +1,5 @@ /** - * Copyright (C) 2013-2014 Justin James. + * Copyright (C) 2013-2015 Justin James. * * This license must be preserved. * Any applications, libraries, or code which make any use of any @@ -96,7 +96,7 @@ namespace Jupiter * @param Address for client to bind to. * @return True on success, false otherwise. */ - virtual bool connectToHost(const char *hostname, unsigned short iPort, const char *clientAddress = nullptr, unsigned short clientPort = 0) override; + virtual bool connect(const char *hostname, unsigned short iPort, const char *clientAddress = nullptr, unsigned short clientPort = 0) override; /** * @brief Interface to provide simple binding to ports. @@ -106,7 +106,7 @@ namespace Jupiter * @param andListen True if listen() should be called, false otherwise. * @return True on success, false otherwise. */ - virtual bool bindToPort(const char *hostname, unsigned short iPort, bool andListen = true) override; + virtual bool bind(const char *hostname, unsigned short iPort, bool andListen = true) override; /** * @brief Accepts an incoming connection for the port bound to. diff --git a/Jupiter/Socket.cpp b/Jupiter/Socket.cpp index fca30e3..eee7a90 100644 --- a/Jupiter/Socket.cpp +++ b/Jupiter/Socket.cpp @@ -148,17 +148,17 @@ int Jupiter::Socket::getProtocol() const return Jupiter::Socket::data_->sockProto; } -bool Jupiter::Socket::connectToHost(addrinfo *info) +bool Jupiter::Socket::connect(addrinfo *info) { #if defined _WIN32 if (!socketInit && !Jupiter::Socket::init()) return false; #endif // _WIN32 Jupiter::Socket::data_->rawSock = socket(info->ai_family, Jupiter::Socket::data_->sockType, Jupiter::Socket::data_->sockProto); - if (Jupiter::Socket::data_->rawSock == INVALID_SOCKET || (Jupiter::Socket::data_->sockType != SOCK_RAW && Jupiter::Socket::data_->sockProto != IPPROTO_RAW && connect(Jupiter::Socket::data_->rawSock, info->ai_addr, info->ai_addrlen) == SOCKET_ERROR)) return false; + if (Jupiter::Socket::data_->rawSock == INVALID_SOCKET || (Jupiter::Socket::data_->sockType != SOCK_RAW && Jupiter::Socket::data_->sockProto != IPPROTO_RAW && ::connect(Jupiter::Socket::data_->rawSock, info->ai_addr, info->ai_addrlen) == SOCKET_ERROR)) return false; return true; } -bool Jupiter::Socket::connectToHost(const char *hostname, unsigned short iPort, const char *clientAddress, unsigned short clientPort) +bool Jupiter::Socket::connect(const char *hostname, unsigned short iPort, const char *clientAddress, unsigned short clientPort) { #if defined _WIN32 if (!socketInit && !Jupiter::Socket::init()) return false; @@ -180,8 +180,8 @@ bool Jupiter::Socket::connectToHost(const char *hostname, unsigned short iPort, sockaddr *asock = ainfo->ai_addr; Jupiter::Socket::data_->rawSock = socket(ainfo->ai_family, Jupiter::Socket::data_->sockType, Jupiter::Socket::data_->sockProto); if (Jupiter::Socket::data_->rawSock == INVALID_SOCKET) continue; - if (clientAddress != nullptr) this->bindToPort(clientAddress, clientPort, false); - if (connect(Jupiter::Socket::data_->rawSock, asock, ainfo->ai_addrlen) == SOCKET_ERROR) + if (clientAddress != nullptr) this->bind(clientAddress, clientPort, false); + if (::connect(Jupiter::Socket::data_->rawSock, asock, ainfo->ai_addrlen) == SOCKET_ERROR) { i++; continue; @@ -192,7 +192,7 @@ bool Jupiter::Socket::connectToHost(const char *hostname, unsigned short iPort, return false; } -bool Jupiter::Socket::bindToPort(const char *hostname, unsigned short iPort, bool andListen) +bool Jupiter::Socket::bind(const char *hostname, unsigned short iPort, bool andListen) { #if defined _WIN32 if (!socketInit && !Jupiter::Socket::init()) return false; @@ -212,7 +212,7 @@ bool Jupiter::Socket::bindToPort(const char *hostname, unsigned short iPort, boo return false; } Jupiter::Socket::data_->rawSock = socket(ainfo->ai_family, Jupiter::Socket::data_->sockType, Jupiter::Socket::data_->sockProto); - if (Jupiter::Socket::data_->rawSock == INVALID_SOCKET || bind(Jupiter::Socket::data_->rawSock, ainfo->ai_addr, ainfo->ai_addrlen) == SOCKET_ERROR) + if (Jupiter::Socket::data_->rawSock == INVALID_SOCKET || ::bind(Jupiter::Socket::data_->rawSock, ainfo->ai_addr, ainfo->ai_addrlen) == SOCKET_ERROR) { i++; continue; diff --git a/Jupiter/Socket.h b/Jupiter/Socket.h index bcd40ed..958b76f 100644 --- a/Jupiter/Socket.h +++ b/Jupiter/Socket.h @@ -1,5 +1,5 @@ /** - * Copyright (C) 2013-2014 Justin James. + * Copyright (C) 2013-2015 Justin James. * * This license must be preserved. * Any applications, libraries, or code which make any use of any @@ -215,7 +215,7 @@ namespace Jupiter * @param info addrinfo containing the information required to initialize the socket and attempt a connection. * @return True on success, false otherwise. */ - virtual bool connectToHost(addrinfo *info); + virtual bool connect(addrinfo *info); /** * @brief Interface to provide simple connection establishing. @@ -226,7 +226,7 @@ namespace Jupiter * @param clientPort Optional parameter to specify the port for socket to bind to. * @return True on success, false otherwise. */ - virtual bool connectToHost(const char *hostname, unsigned short iPort, const char *clientHostname = nullptr, unsigned short clientPort = 0); + virtual bool connect(const char *hostname, unsigned short iPort, const char *clientHostname = nullptr, unsigned short clientPort = 0); /** * @brief Interface to provide simple binding to ports. @@ -236,7 +236,7 @@ namespace Jupiter * @param andListen True if listen() should be called, false otherwise. * @return True on success, false otherwise. */ - virtual bool bindToPort(const char *hostname, unsigned short iPort, bool andListen = true); + virtual bool bind(const char *hostname, unsigned short iPort, bool andListen = true); /** * @brief Accepts an incoming connection for the port bound to. diff --git a/Jupiter/TCPSocket.h b/Jupiter/TCPSocket.h index c4a9608..7a130d6 100644 --- a/Jupiter/TCPSocket.h +++ b/Jupiter/TCPSocket.h @@ -1,5 +1,5 @@ /** - * Copyright (C) 2013-2014 Justin James. + * Copyright (C) 2013-2015 Justin James. * * This license must be preserved. * Any applications, libraries, or code which make any use of any diff --git a/Jupiter/UDPSocket.h b/Jupiter/UDPSocket.h index 7ecd0a5..72acf11 100644 --- a/Jupiter/UDPSocket.h +++ b/Jupiter/UDPSocket.h @@ -1,5 +1,5 @@ /** - * Copyright (C) 2013-2014 Justin James. + * Copyright (C) 2013-2015 Justin James. * * This license must be preserved. * Any applications, libraries, or code which make any use of any diff --git a/Release/Jupiter.lib b/Release/Jupiter.lib index 5fc6d9b..83b6234 100644 Binary files a/Release/Jupiter.lib and b/Release/Jupiter.lib differ