Fixes to make rnet and it's examples build on Windows in visual studio 2019. (#1602)

Mostly typecasts, and some int to unsigned short changes, and including the windsock 2 library in the examples.

Co-authored-by: Jeffery Myers <JefMyers@blizzard.com>
This commit is contained in:
Jeffery Myers 2021-02-20 12:13:20 -08:00 committed by GitHub
parent eb47cc5e93
commit 0726491ef8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 78 additions and 74 deletions

View file

@ -80,7 +80,7 @@ int main(void)
// IsSocketReady, if the socket is ready, attempt to receive data from the socket
int bytesRecv = 0;
if (IsSocketReady(clientResult->socket)) bytesRecv = SocketReceive(clientResult->socket, receiveBuffer, strlen(pingmsg) + 1);
if (IsSocketReady(clientResult->socket)) bytesRecv = SocketReceive(clientResult->socket, receiveBuffer, (int)strlen(pingmsg) + 1);
// If we received data, was that data a "Ping!" or a "Pong!"
if (bytesRecv > 0)
@ -96,12 +96,12 @@ int main(void)
if (ping)
{
ping = false;
SocketSend(clientResult->socket, pingmsg, strlen(pingmsg) + 1);
SocketSend(clientResult->socket, pingmsg, (int)strlen(pingmsg) + 1);
}
else if (pong)
{
pong = false;
SocketSend(clientResult->socket, pongmsg, strlen(pingmsg) + 1);
SocketSend(clientResult->socket, pongmsg, (int)strlen(pingmsg) + 1);
}
elapsed = 0.0f;