diff options
author | 2024-04-22 08:04:58 +1000 | |
---|---|---|
committer | 2024-04-22 08:04:58 +1000 | |
commit | 184292b730f4236bd4840e780fdad97ee060ec84 (patch) | |
tree | 67902161a465fe92aec78ca502de07092b8cde0f /3rdparty/asio/src/examples/cpp03/local/iostream_client.cpp | |
parent | 24154bc1f00790f344120b3a85175d6f616c5ad0 (diff) |
3rdparty/asio: Updated to 1.30.2
Diffstat (limited to '3rdparty/asio/src/examples/cpp03/local/iostream_client.cpp')
-rw-r--r-- | 3rdparty/asio/src/examples/cpp03/local/iostream_client.cpp | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/3rdparty/asio/src/examples/cpp03/local/iostream_client.cpp b/3rdparty/asio/src/examples/cpp03/local/iostream_client.cpp deleted file mode 100644 index 8c6274a70ad..00000000000 --- a/3rdparty/asio/src/examples/cpp03/local/iostream_client.cpp +++ /dev/null @@ -1,62 +0,0 @@ -// -// stream_client.cpp -// ~~~~~~~~~~~~~~~~~ -// -// Copyright (c) 2003-2021 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 <cstring> -#include <iostream> -#include "asio.hpp" - -#if defined(ASIO_HAS_LOCAL_SOCKETS) - -using asio::local::stream_protocol; - -enum { max_length = 1024 }; - -int main(int argc, char* argv[]) -{ - try - { - if (argc != 2) - { - std::cerr << "Usage: iostream_client <file>\n"; - return 1; - } - - stream_protocol::endpoint ep(argv[1]); - stream_protocol::iostream s(ep); - if (!s) - { - std::cerr << "Unable to connect: " << s.error().message() << std::endl; - return 1; - } - - using namespace std; // For strlen. - std::cout << "Enter message: "; - char request[max_length]; - std::cin.getline(request, max_length); - size_t length = strlen(request); - s << request; - - char reply[max_length]; - s.read(reply, length); - std::cout << "Reply is: "; - std::cout.write(reply, length); - std::cout << "\n"; - } - catch (std::exception& e) - { - std::cerr << "Exception: " << e.what() << "\n"; - } - - return 0; -} - -#else // defined(ASIO_HAS_LOCAL_SOCKETS) -# error Local sockets not available on this platform. -#endif // defined(ASIO_HAS_LOCAL_SOCKETS) |