简体   繁体   中英

How to set Websocketpp buffer size?

I would like to set the max buffer size for servers and client to 10 messages only. So that the Websocketpp will discard any messages, if the buffer exceeds 10 messages.

how can I discard all the messages in the buffer using websocketpp code? Thanks

I checked out the documentation, which you can find here: https://docs.websocketpp.org/reference_8config.html

It seems that you can only limit the size of each message using max_message_size , but not the total number of messages.

You can also try to use connection_read_buffer_size for reducing the read buffer size to optimize for small messages, if this is what you are looking for.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM