Still fighting with MSVC. Several linker errors.

This commit is contained in:
2025-02-21 02:09:41 -06:00
parent 9c21fe26a4
commit 741ca0c74f
4 changed files with 13 additions and 4 deletions

View File

@@ -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 {

View File

@@ -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

View File

@@ -1,4 +1,6 @@
#include "Sockets/IPAddress.hpp"
#include <ws2tcpip.h>
#include <Sockets/Exceptions.hpp>
#include <Sockets/Commons.hpp>

View File

@@ -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());
}