AlexanderJDupree / Bridges

HTTP/S Server and Library for C++
MIT License
2 stars 0 forks source link

[DISCUSSION] - Prototype SocketStreams #5

Closed AlexanderJDupree closed 4 years ago

AlexanderJDupree commented 4 years ago

After accepting a tcp connection the server must receive the data via the recv() system call. This system call takes in a char buffer and its size and only fills the buffer up to the provided size. This is a perfect fit for a stream abstraction so that when we parse the request we don't have to worry about the low level details of buffer size, incomplete messages etc.

Proposal to prototype Socket_Stream implementations that would continually call the recv() function with a fixed sized buffer and dump the contents into a stream. We could use std::stringstream for this or roll our own stream implementation.

AlexanderJDupree commented 4 years ago

Strategy: