- Timestamp:
- Jul 14, 2013, 9:22:38 PM (12 years ago)
- Branches:
- master
- Children:
- 10f6fc2
- Parents:
- 5a64bea
- Location:
- common
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
common/Message.cpp
r5a64bea r9b5d30b 15 15 using namespace std; 16 16 17 /* 17 18 int sendMessage(NETWORK_MSG *msg, int sock, struct sockaddr_in *dest) 18 19 { … … 33 34 return ret; 34 35 } 36 */ -
common/Message.h
r5a64bea r9b5d30b 26 26 } NETWORK_MSG; 27 27 28 int sendMessage(NETWORK_MSG *msg, int sock, struct sockaddr_in *dest);28 //int sendMessage(NETWORK_MSG *msg, int sock, struct sockaddr_in *dest); 29 29 30 int receiveMessage(NETWORK_MSG *msg, int sock, struct sockaddr_in *source);30 //int receiveMessage(NETWORK_MSG *msg, int sock, struct sockaddr_in *source); 31 31 32 32 #endif -
common/MessageProcessor.cpp
r5a64bea r9b5d30b 11 11 12 12 int MessageProcessor::sendMessage(NETWORK_MSG *msg, int sock, struct sockaddr_in *dest) { 13 msg->id = ++lastUsedId; 13 14 MessageContainer message(*msg, *dest); 14 message.id = ++lastUsedId; 15 sentMessages[message.id] = message; 15 sentMessages[msg->id] = message; 16 16 17 17 int ret = sendto(sock, (char*)msg, sizeof(NETWORK_MSG), 0, (struct sockaddr *)dest, sizeof(struct sockaddr_in)); -
common/MessageProcessor.h
r5a64bea r9b5d30b 59 59 60 60 MessageContainer(const MessageContainer& mc) { 61 this-> id = mc.id;61 this->msg = mc.msg; 62 62 this->clientAddr = mc.clientAddr; 63 this->msg = mc.msg;64 this->ackReceived = mc.ackReceived;65 63 } 66 64 … … 73 71 } 74 72 75 int id;73 NETWORK_MSG msg; 76 74 struct sockaddr_in clientAddr; 77 NETWORK_MSG msg;78 bool ackReceived;79 75 }; 80 76
Note:
See TracChangeset
for help on using the changeset viewer.