Changeset 9c83610 in network-game for common


Ignore:
Timestamp:
Dec 30, 2012, 7:19:04 PM (12 years ago)
Author:
dportnoy <dmp1488@…>
Branches:
master
Children:
38b85bb
Parents:
cee623e
Message:

Added debug messages to Message.cpp

File:
1 edited

Legend:

Unmodified
Added
Removed
  • common/Message.cpp

    rcee623e r9c83610  
    1111#endif
    1212
     13#include <iostream>
     14
     15using namespace std;
     16
    1317int sendMessage(NETWORK_MSG *msg, int sock, struct sockaddr_in *dest)
    1418{
    1519   return sendto(sock, (char*)msg, sizeof(NETWORK_MSG), 0, (struct sockaddr *)dest, sizeof(struct sockaddr_in));
     20
     21   cout << "Sent message of type " << msg->type << endl;
    1622}
    1723
     
    2228   // assume we don't care about the value of socklen
    2329   return recvfrom(sock, (char*)msg, sizeof(NETWORK_MSG), 0, (struct sockaddr *)dest, &socklen);
     30
     31   cout << "Received message of type " << msg->type << endl;
    2432}
Note: See TracChangeset for help on using the changeset viewer.