Changeset 38b85bb in network-game for common/Message.cpp
- Timestamp:
- Dec 30, 2012, 7:27:10 PM (12 years ago)
- Branches:
- master
- Children:
- 8f438a5
- Parents:
- 9c83610
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
common/Message.cpp
r9c83610 r38b85bb 17 17 int sendMessage(NETWORK_MSG *msg, int sock, struct sockaddr_in *dest) 18 18 { 19 returnsendto(sock, (char*)msg, sizeof(NETWORK_MSG), 0, (struct sockaddr *)dest, sizeof(struct sockaddr_in));19 int ret = sendto(sock, (char*)msg, sizeof(NETWORK_MSG), 0, (struct sockaddr *)dest, sizeof(struct sockaddr_in)); 20 20 21 21 cout << "Sent message of type " << msg->type << endl; 22 23 return ret; 22 24 } 23 25 … … 27 29 28 30 // assume we don't care about the value of socklen 29 returnrecvfrom(sock, (char*)msg, sizeof(NETWORK_MSG), 0, (struct sockaddr *)dest, &socklen);31 int ret = recvfrom(sock, (char*)msg, sizeof(NETWORK_MSG), 0, (struct sockaddr *)dest, &socklen); 30 32 31 33 cout << "Received message of type " << msg->type << endl; 34 35 return ret; 32 36 }
Note:
See TracChangeset
for help on using the changeset viewer.