1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-20 05:23:04 +01:00

Start implementing TCP API

This commit is contained in:
Ted John
2020-08-17 03:53:37 +01:00
parent 359bbee9f5
commit dce547af99
9 changed files with 449 additions and 1 deletions

View File

@@ -34,6 +34,9 @@
#ifndef SHUT_RD
#define SHUT_RD SD_RECEIVE
#endif
#ifndef SHUT_WR
#define SHUT_WR SD_SEND
#endif
#ifndef SHUT_RDWR
#define SHUT_RDWR SD_BOTH
#endif
@@ -464,6 +467,14 @@ public:
thread.detach();
}
void Finish() override
{
if (_status == SOCKET_STATUS_CONNECTED)
{
shutdown(_socket, SHUT_WR);
}
}
void Disconnect() override
{
if (_status == SOCKET_STATUS_CONNECTED)
@@ -844,6 +855,7 @@ void DisposeWSA()
std::unique_ptr<ITcpSocket> CreateTcpSocket()
{
InitialiseWSA();
return std::make_unique<TcpSocket>();
}