This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <algorithm> | |
#include <fstream> | |
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include "async_simple/coro/Lazy.h" | |
#include "async_simple/coro/SyncAwait.h" | |
// asio_coro_util.hpp 在 demo_example 下, 这里仅仅为了调用 AsioCallbackAwaiter 这个简单的 Awaiter 而已. | |
#include "asio_coro_util.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <coroutine> | |
#include <functional> | |
#include <type_traits> | |
#if defined(DEBUG) || defined(_DEBUG) | |
#include <unordered_set> | |
std::unordered_set<void*> global_crors; | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ssl_stream.hpp | |
// ~~~~~~~~~~~~~~ | |
// | |
// Copyright (c) 2023 Jack (jack dot wgm at gmail 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) | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void print_data_len(const std::vector<uint8_t>& data, uint16_t target_len = 0x7FFF) | |
{ | |
if (data.size() < 4) { | |
std::cerr << "数据长度小于4,无法转换为 uint16_t。" << std::endl; | |
return; | |
} | |
std::cout << "print len: " << data.size() << "\n"; | |
uint16_t p1 = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Copyright (C) 2019 Jack. | |
// | |
// Author: jack | |
// Email: jack.wgm at gmail dot com | |
// | |
#pragma once | |
#include <version> | |
#include <codecvt> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// yield_cancellation_slot_bind.hpp | |
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
// | |
// Copyright (c) 2019 Jack (jack dot wgm at gmail 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) | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// async_connect.hpp | |
// ~~~~~~~~~~~~~~~~~ | |
// | |
// Copyright (c) 2019 Jack (jack dot wgm at gmail 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) | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// yield_cancellation_slot_bind.hpp | |
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
// | |
// Copyright (c) 2019 Jack (jack dot wgm at gmail 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) | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#c:: | |
Send,^{c} | |
Return | |
#v:: | |
Send,^{v} | |
Return | |
#s:: | |
Send,^{s} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Copyright (C) 2021 Jack. | |
// | |
// Author: jack | |
// Email: jack.wgm at gmail dot com | |
// | |
#pragma once | |
#include <boost/exception/all.hpp> |
NewerOlder