mirror of
https://github.com/wiiu-env/wut.git
synced 2024-12-13 04:42:43 +01:00
Fix udplogserver Linux build
This commit is contained in:
parent
e0f1b03edf
commit
c265a9f4db
@ -1,13 +1,17 @@
|
||||
#ifdef _WIN32
|
||||
#include <WinSock2.h>
|
||||
#else
|
||||
#include <sys/socket.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
|
||||
#define SERVER_PORT 4405
|
||||
|
||||
@ -77,7 +81,11 @@ int main(int argc, char **argv)
|
||||
|
||||
if (select(fd + 1, &fdsRead, NULL, NULL, &tv) == 1) {
|
||||
struct sockaddr_in from;
|
||||
#ifdef _WIN32
|
||||
int fromLen = sizeof(from);
|
||||
#else
|
||||
socklen_t fromLen = sizeof(from);
|
||||
#endif
|
||||
int recvd = recvfrom(fd, buffer, sizeof(buffer), 0, (struct sockaddr *) &from, &fromLen);
|
||||
|
||||
if (recvd > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user