Právě prohlížíš: sockets/main.cpp
Zpět do složkyStáhnout
  1. #include "main.h"
  2.  
  3.  
  4. void secondThread();
  5.  
  6. using namespace std;
  7.  
  8. bool running = true;
  9.  
  10. int main() {
  11. cout<<"Hello world!\n";
  12. boost::thread workerThread(secondThread);
  13. string input;
  14. while(running) {
  15. getline (cin,input);
  16. cout<<input<<"\n";
  17. if(input.length()>0) {
  18. if(std::strcmp(input.c_str(),"exit")) {
  19. running=false;
  20. }
  21.  
  22.  
  23. }
  24. }
  25. system("pause");
  26. }
  27. void secondThread() {
  28. SocketClient scl;
  29. scl.init("127.0.0.1", "80");
  30. scl.connect();
  31. while(running) {
  32. scl.send(44,"GET /style-v2/section-basic.css HTTP/1.1\n\n");
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46. }
  47. }
Parsed using GeSHi 1.0.8.11 at 0.008