mattgodbolt / seasocks

Simple, small, C++ embeddable webserver with WebSockets support

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

type overflow _bytesSent

friackazoid opened this issue · comments

Hello, dear seasocks developers,

I have some questions regarding the variables _bytesSent and _bytesReceived (https://github.com/mattgodbolt/seasocks/blob/master/src/main/c/seasocks/Connection.h#L205).

As they are defined as size_t, these numbers are expected to increase during the program's lifetime. However, it is essential to consider that the size_t data type has a maximum value, which is implementation-dependent (https://en.cppreference.com/w/c/types/size_t). Although it can represent a large range of values, it still has some limitations.

I could not find any checks or resets of these variables in the code. Therefore, my question is whether you have any expectations or recommendations for handlers to reset the connection after some time to prevent potential overflow of the size_t data type in these variables.

I appreciate your guidance on this matter and look forward to your insights.

Thank you in advance.