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

Websocket example #2917

Open
Dimitrius-dev opened this issue Aug 8, 2024 · 9 comments
Open

Websocket example #2917

Dimitrius-dev opened this issue Aug 8, 2024 · 9 comments

Comments

@Dimitrius-dev
Copy link

Hello,
Boost=1.84.0, BOOST_BEAST_VERSION=351
I am using boost/beast websocket TLS async client example link. I noticed my connection disconnects sometimes with stream truncated and eof. What do these errors mean? I checked my internet connection with wireshark and it's fine.

@ashtum
Copy link
Collaborator

ashtum commented Aug 8, 2024

Do they happen at the end of stream? error::stream_truncated

@Dimitrius-dev
Copy link
Author

No, i get these errors without calling any shutdown or disconnect function. And it shows when use client for high load traffic (high frequency).

@ashtum
Copy link
Collaborator

ashtum commented Aug 8, 2024

Are you sure it’s not the server that dropped the connection? Does this happen with just one specific server?

@Dimitrius-dev
Copy link
Author

Dimitrius-dev commented Aug 26, 2024

Can connection issues occur if multiply connections use load_certificates function?

@ashtum
Copy link
Collaborator

ashtum commented Aug 26, 2024

Do you mean load_root_certificates? it calls ssl::context::add_certificate_authority which is not thread safe.

@Dimitrius-dev
Copy link
Author

I made n threads. Every thread has its own asio context, and interact with the same internet resource

@ashtum
Copy link
Collaborator

ashtum commented Aug 26, 2024

Do they have their own ssl::context too?

@Dimitrius-dev
Copy link
Author

yes

@ashtum
Copy link
Collaborator

ashtum commented Aug 26, 2024

Have you tried reducing your application to a single connection and a single thread to see if the issue still exists? If possible, test one of the existing examples.

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