Changeset e084950 in network-game for common


Ignore:
Timestamp:
Nov 23, 2012, 8:52:59 PM (12 years ago)
Author:
dportnoy <dmp1488@…>
Branches:
master
Children:
6c92572
Parents:
d87708d
Message:

Converted the server to use sendMessage and receiveMessage and it now asks the user to guess a number between 1 and 1000

Location:
common
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • common/compiler.h

    rd87708d re084950  
    1 #ifdef _WIN64
     1#if defined _WIN64
    22        #define WINDOWS
    3 #elif _WIN32
     3#elif defined _WIN32
    44        #define WINDOWS
    5 #elif __linux
     5#elif defined __linux
    66        #define LINUX
    7 #elif __unix
     7#elif defined __unix
    88        #define LINUX
    9 #elif __posix
     9#elif defined __posix
    1010        #define LINUX
    1111#endif
  • common/message.cpp

    rd87708d re084950  
    33#include "compiler.h"
    44
    5 #ifdef WINDOWS
     5#if defined WINDOWS
    66        #include <winsock2.h>
     7#elif defined LINUX
     8        #include <sys/socket.h>
     9        #include <netinet/in.h>
    710#endif
    811
     
    1417int receiveMessage(NETWORK_MSG *msg, int sock, struct sockaddr_in *dest)
    1518{
    16         int socklen = sizeof(struct sockaddr_in);
     19        socklen_t socklen = sizeof(struct sockaddr_in);
    1720
    1821        // assume we don't care about the value of socklen
Note: See TracChangeset for help on using the changeset viewer.