Still fighting with MSVC. Several linker errors.
This commit is contained in:
@@ -26,7 +26,7 @@ namespace Socket {
|
||||
|
||||
class BadUriException : public SocketException {
|
||||
public:
|
||||
BadUriException(char *msg) : SocketException{msg} {}
|
||||
BadUriException(const char *msg) : SocketException{msg} {}
|
||||
};
|
||||
|
||||
class SocketBindingException : public SocketException {
|
||||
|
@@ -2,6 +2,13 @@
|
||||
|
||||
#include <Sockets/IPAddress.hpp>
|
||||
#include <string>
|
||||
#if defined(__linux__) || defined(__APPLE__)
|
||||
|
||||
#elif defined(_WIN32)
|
||||
#include <ws2tcpip.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// Game-specific Network code written against GameNetworkingSocket API
|
||||
|
||||
|
@@ -1,4 +1,6 @@
|
||||
#include "Sockets/IPAddress.hpp"
|
||||
|
||||
#include <ws2tcpip.h>
|
||||
#include <Sockets/Exceptions.hpp>
|
||||
#include <Sockets/Commons.hpp>
|
||||
|
||||
|
@@ -91,7 +91,7 @@ namespace Socket
|
||||
void UdpSocket_Old::Connect(const std::string& hostname, u16 port)
|
||||
{
|
||||
auto ipaddr = IPAddress::Resolve(hostname, port);
|
||||
this->Connect(ipaddr, port);
|
||||
this->Connect(ipaddr);
|
||||
}
|
||||
void UdpSocket_Old::Connect(const IPAddress& ipaddr)
|
||||
{
|
||||
@@ -160,7 +160,7 @@ namespace Socket
|
||||
|
||||
int UdpSocket_Old::Send(const u8 *data, unsigned int length, int flags)
|
||||
{
|
||||
int ret = ::send(sock, data, length, flags);
|
||||
int ret = ::send(sock,reinterpret_cast<const char*>(data), length, flags);
|
||||
|
||||
if (ret < 0)
|
||||
CheckErrors_send(errno);
|
||||
@@ -169,7 +169,7 @@ namespace Socket
|
||||
|
||||
int UdpSocket_Old::Send(const std::vector<u8>& payload)
|
||||
{
|
||||
this->Send(payload.data(), payload.size());
|
||||
return this->Send(payload.data(), payload.size());
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user