- Timestamp:
- Nov 26, 2012, 9:00:11 PM (12 years ago)
- Branches:
- master
- Children:
- 4da5aa3
- Parents:
- 633f42a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
client/Client/main.cpp
r633f42a ra4db787 138 138 al_flip_display(); 139 139 140 int sock , n;140 int sock; 141 141 struct sockaddr_in server, from; 142 142 struct hostent *hp; … … 207 207 msgTo.type = MSG_TYPE_LOGIN; 208 208 username = input; 209 209 210 break; 210 211 } … … 220 221 else 221 222 msgTo.type = MSG_TYPE_CHAT; 223 222 224 break; 223 225 } … … 236 238 } 237 239 238 n=sendMessage(&msgTo, sock, &server); 239 if (n < 0) 240 error("sendMessage"); 241 242 n = receiveMessage(&msgFrom, sock, &from); 243 if (n < 0) 244 error("receiveMessage"); 245 240 sendMessage(&msgTo, sock, &server); 241 242 receiveMessage(&msgFrom, sock, &from); 246 243 string response = string(msgFrom.buffer); 247 244 245 // this whole select block should go in a new function. 246 // Figure out how to pass and return params properly 248 247 switch(state) 249 248 { … … 262 261 state = STATE_LOGIN; 263 262 } 263 264 264 break; 265 265 }
Note:
See TracChangeset
for help on using the changeset viewer.