Skip to content

August 30, 2024

🌊 Sane C++ August 2024#

SC

Welcome to the update post for August 2024!
August has been spent doing some first round of improvements to the SC::Http library.

📄 Sane C++ Libraries Documentation
💻 Sane C++ Libraries Repository
📹 Sane Coding Youtube channel
💬 Sane Coding Discord

SC::Http#

Pushing it forward

The HTTP library is still very incomplete and fragile, but it got to the level of being able serving a simple local html web site, through the new SC::HttpWebServer class. The SC::HttpServer / SC::HttpWebServer classes are not solid enough to be used in real internet facing application but they're in better shape than they were the previous month. SC::HttpClient is just a very incomplete stub and it currently exists to help testing the server classes.
In the following video a first draft of the HttpWebServer class is being implemented:

This is the list of SC::Http related commits:

SCExample#

Serialize all the things

SCExample has now a second example called WebServer that can host a website on a specific port reading files from a local folder, all integrated with a GUI interface. The example interface now has two new methods (initAsync / closeAsync) to let samples access the main SC::AsyncEventLoop of the application. The async io event loop is integrated with gui event loop on main thread to make sure that all examples using SC::Async can see their completions dispatched on the main (gui) thread. This means that they can modify the same state variables used by the GUI without needing mutexes.

SC::Async#

Your next favorite Async IO library

Implementing the SC::HttpWebServer has been putting a little bit of stress on the SC::Async library, with a few new features, and some bug fixes and QOL improvements.

Features

SC::AsyncSocketReceive and SC::AsyncFileRead report End Of File and disconnected events on all platforms, signaling when they are running out of data.

Bugs (fixed)

  • SC::AsyncSocketWrite writes were not properly handled on Posix with large buffers (and now there's a test for that)
  • Timer callbacks were called multiple times on the io_uring backend

Quality of Life improvements

It's possible now to de-allocate any SC::AsyncRequest derived request inside its own callback or just re-configure them and start them again. That should make it a lot easier handling more complex async data flows.

Additional fixes#

Fix fix fix

And just like every month, a bunch of fixes and improvements to all libraries have been committed. The most notable bug was in the SC::Process library, that was preventing proper stdout inheritance for console applications on Windows. Github CI was missing all output of the cl.exe and link.exe msvc executables spawned by SC::Build during compilation. Specifically the Win10/MSVC2019 ci job was failing without printing any error, making it really difficult to figure out how to fix it!