- Timestamp:
- Dec 24, 2013, 8:06:30 PM (11 years ago)
- Branches:
- master
- Children:
- 9c18cb7
- Parents:
- 68d94de
- Location:
- common
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
common/Common.cpp
r68d94de r8554263 13 13 #include <cmath> 14 14 #include <ctime> 15 #include <cstdlib> 16 #include <cstdio> 15 17 16 18 using namespace std; … … 30 32 31 33 return position; 34 } 35 36 // This might not be cross-platform. Verify that this works correctly or fix it. 37 void error(const char *msg) 38 { 39 perror(msg); 40 exit(0); 32 41 } 33 42 -
common/Common.h
r68d94de r8554263 20 20 }; 21 21 22 void error(const char *msg); 22 23 void set_nonblock(int sock); 23 24 unsigned long long getCurrentMillis(); -
common/MessageProcessor.cpp
r68d94de r8554263 40 40 int ret = sendto(sock, (char*)msg, sizeof(NETWORK_MSG), 0, (struct sockaddr *)dest, sizeof(struct sockaddr_in)); 41 41 42 return ret; 42 if (ret < 0) 43 error("sendMessage"); 44 else 45 return ret; 43 46 } 44 47
Note:
See TracChangeset
for help on using the changeset viewer.