Changeset 6 in chevmsgr for trunk/msgsrv.cpp
- Timestamp:
- 08/29/15 02:20:50 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/msgsrv.cpp
r4 r6 283 283 } 284 284 285 static bool command(const Message::Parser& parser)285 static bool command(const Protocol::Message & parser) 286 286 { 287 287 bool isContinued = true; … … 305 305 } 306 306 307 static std::string httpSMS(const Message::Parser& parser)307 static std::string httpSMS(const Protocol::Message & parser) 308 308 { 309 309 std::string phone = parser.get<std::string>("phone"); … … 319 319 CRLF; 320 320 321 Message::Response response;321 Protocol::Response response; 322 322 cf::network::tcp smsSock; 323 323 cf::network::host smsServer(url, 80); … … 330 330 } 331 331 332 static bool join(const Message::Parser& parser, const std::string & sms, const std::string & address)332 static bool join(const Protocol::Message & parser, const std::string & sms, const std::string & address) 333 333 throw (cf::exception) 334 334 { … … 342 342 } 343 343 344 static bool login(const Message::Parser& parser)344 static bool login(const Protocol::Message & parser) 345 345 throw (cf::exception) 346 346 { … … 351 351 } 352 352 353 static bool chat(const Message::Parser& parser,353 static bool chat(const Protocol::Message & parser, 354 354 const std::string & message) 355 355 { … … 381 381 while (true) 382 382 { 383 Message::Parserparser;383 Protocol::Message parser; 384 384 parser.parse(sock.receive().toString()); 385 385 … … 417 417 workerInitiator(*sock); 418 418 419 Message::Response response;419 Protocol::Response response; 420 420 bool result = true; 421 421 … … 423 423 { 424 424 std::string message = sock->receive().toString(); 425 Message::Parserparser;425 Protocol::Message parser; 426 426 parser.parse(message); 427 427 … … 433 433 result = chat(parser, message); 434 434 435 sock->send(response.result( result));435 sock->send(response.result(parser.type(), result)); 436 436 } 437 437 }
Note:
See TracChangeset
for help on using the changeset viewer.