Advertisement
Vlad3955

main.cpp

Oct 22nd, 2022 (edited)
858
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1. #include "tcp_server.h"
  2.  
  3. int main(int argc, char const* argv[])
  4. //int main()
  5. {
  6.  
  7.     if (argc != 2)
  8.     {
  9.         std::cout << "Usage: " << argv[0] << " <port>" << std::endl;
  10.         return EXIT_FAILURE;
  11.     }
  12.  
  13.     const int port{ std::stoi(argv[1]) };
  14.     //const int port{ std::stoi("15234")};
  15.     socket_wrapper::SocketWrapper sock_wrap;
  16.     Connecter connecter;
  17.  
  18.     std::cout << "Starting TCP-server on the port " << port << "...\n";
  19.  
  20.     socket_wrapper::Socket sock = connecter.connect_to_client(port);
  21.  
  22.     TCPserver tcpserver(std::move(sock));
  23.     tcpserver.server_run();
  24.    
  25.  
  26.     return EXIT_SUCCESS;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement