1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-26 08:14:38 +01:00

Fix TcpSocket for Linux compilers (#13)

This commit is contained in:
Michał Janiszewski
2016-06-02 10:13:25 +02:00
committed by Ted John
parent 8dfbabbd07
commit e3d04ff96d
2 changed files with 8 additions and 8 deletions

View File

@@ -74,7 +74,7 @@ public:
struct ConnectRequest
{
TcpSocket * TcpSocket;
TcpSocket * Socket;
std::string Address;
uint16 Port;
};
@@ -309,7 +309,7 @@ public:
{
// Spin off a worker thread for resolving the address
auto req = new ConnectRequest();
req->TcpSocket = this;
req->Socket = this;
req->Address = std::string(address);
req->Port = port;
SDL_CreateThread([](void * pointer) -> int
@@ -317,15 +317,15 @@ public:
auto req = (ConnectRequest *)pointer;
try
{
req->TcpSocket->Connect(req->Address.c_str(), req->Port);
req->Socket->Connect(req->Address.c_str(), req->Port);
}
catch (Exception ex)
{
req->TcpSocket->_error = std::string(ex.GetMsg());
req->Socket->_error = std::string(ex.GetMsg());
}
delete req;
SDL_UnlockMutex(req->TcpSocket->_connectMutex);
SDL_UnlockMutex(req->Socket->_connectMutex);
return 0;
}, 0, req);
}
@@ -386,7 +386,7 @@ public:
}
}
void Close()
void Close() override
{
SDL_LockMutex(_connectMutex);
{