Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用 asio::io_context 不能正常访问 #669

Open
osabc opened this issue Dec 12, 2024 · 2 comments
Open

使用 asio::io_context 不能正常访问 #669

osabc opened this issue Dec 12, 2024 · 2 comments

Comments

@osabc
Copy link

osabc commented Dec 12, 2024

#include <cinatra.hpp>

using namespace cinatra;

int main()
{
	asio::io_context ctx;
	http_server server(ctx, 8080);

	server.set_http_handler<GET>("/", [](request& req, response& resp) {
		resp.set_status_and_content(status_type::ok, "hello world");
	});

	server.sync_start();

	return 0;
}
@qicosmos
Copy link
Owner

再认真看下测试case:https://github.com/qicosmos/cinatra/blob/master/tests/test_coro_http_server.cpp#L641
看看自己错在哪里了。

@osabc
Copy link
Author

osabc commented Dec 13, 2024

可以用,就是使用有点复杂能像上面就更好了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants