Daytime.6 소스 (Source listing for Daytime.6) // // server.cpp // ~~~~~~~~~~ // // Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #include #include #include #include #include #include #include using boost::asio::..
Daytime.5 소스 (Source listing for Daytime.5) // // server.cpp // ~~~~~~~~~~ // // Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #include #include #include #include #include using boost::asio::ip::udp; std::stri..
Daytime.5 - 동기식 UDP daytime 서버 (A synchronous UDP daytime server) 이 튜토리얼 프로그램은 asio를 사용하여 UDP용 서버 응용프로그램을 구현하는 방법을 보여준다. int main() { try { boost::asio::io_context io_context; UDP 포트 13번에서 요청을 수신 할 ip::udp::socket 개체를 생성한다. udp::socket socket(io_context, udp::endpoint(udp::v4(), 13)); 클라이언트에서 요청을 시작할 때까지 기다린다. remote_endpoint 개체는 ip::udp::socket::receive_from()에 파라미터로 주어지게 된다. for (;;) { boost::..
Daytime.4 소스 (Source listing for Daytime.4) // // client.cpp // ~~~~~~~~~~ // // Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #include #include #include using boost::asio::ip::udp; int main(int argc, char* ar..