fixed some more examples

fixed the ResolveHost method
added more network specific defines
This commit is contained in:
Jak Barnes 2019-03-17 20:33:22 +00:00
commit 7c2f816852

View file

@ -13,7 +13,7 @@ bool connected = false;
const char * pingmsg = "Ping!";
const char * pongmsg = "Pong!";
int msglen = 0;
SocketConfig client_cfg = {.host = "127.0.0.1", .port = "8080", .type = SOCKET_TCP, .nonblocking = true};
SocketConfig client_cfg = {.host = "127.0.0.1", .port = "4950", .type = SOCKET_TCP, .nonblocking = true};
SocketResult *client_res = NULL;
SocketSet * socket_set = NULL;
char recvBuffer[512];
@ -48,7 +48,7 @@ void NetworkUpdate()
// If the socket is ready, attempt to receive data from the socket
int bytesRecv = 0;
if (IsSocketReady(client_res->socket)) {
bytesRecv = SocketReceive(client_res->socket, recvBuffer, msglen, 0);
bytesRecv = SocketReceive(client_res->socket, recvBuffer, msglen);
}
// If we received data, was that data a "Ping!" or a "Pong!"
@ -77,7 +77,7 @@ int main()
int screenWidth = 800;
int screenHeight = 450;
InitWindow(
screenWidth, screenHeight, "raylib [network] example - ping pong");
screenWidth, screenHeight, "raylib [network] example - tcp client");
SetTargetFPS(60);
SetTraceLogLevel(LOG_DEBUG);