Main  /  Edit version 94  /  Edit version 95  /   /  Users Area

Difference "CppCMS 1.x.x tasks" ver. 94 versus ver. 95

Content:

<!--toc-->
# CppCMS 1.1.0 - Next Release
## Update external modules to updated API
Update PHP, Asp.Net, Java and Python modules to reflect updated API
## Provide Plugin Framework
Allow applications and other tools to be loaded dynamically.
- Convenient API to access shared_objects (Done)
- Call of different templates by names (Done)
- Creation of abstract templates (so no need of link with API) (Done, pending unit test)
- Handle gettext domain properly over plugin - change it per include and not per view, restore at exit (Done, pending unit test)
# CppCMS 1.3.0 and later
## HTTP Server improvements
- Implement HTTP/1.1
- Implement HTTPS
- Provide WebSockets support
- Implement Virtual Hosts support
## Implementing UDP Support for `booster::aio::socket`
Booster.Aio socket supports stream sockets well, but
has very poor (if any) support of data-gram sockets.
You can open them and use them but there are no operations
like `sendto` or `recvfrom` that are data-gram oriented.
Add their implementations to Booster analogously to
implementations of async/sync read/write operations.
## Add Support of multiple event loops
Today, asynchronous applications do not scale
well on multi-core systems.
Add required support of multiple event loops
so different asynchronous applications would
be able to use them.
## Cache Improvements
### Contention
When an entry is invalidated many requests
may try to generate it and create significant load.
Solution, delay "fetch" if some other fetching.
### Active Invalidation
Distributed Cache system implements L1/L2 cache
allowing a cache client to check if the data is
has is still up-to-date without reading it back.
However each access to cache still require TCP-ping-pong.
So instead active cache invalidation may be done: when
trigger is risen or new data is stored a sort of
a message that causes all clients to drop invalid
cache is broad-casted.
Need to be implemented.
### Object invalidation
Use cache to invalidate general object
### Enable O(1) invalidation and lazy collection
- Make triggers refcounted - and keep generation
- Invalidation options:
1. Triggers keep spliceable list of objects that moved to kill list and deleted on demand O(1) operation
2. Triggers do not have list of objects at all but rather have limited access to
## Booster.Filesystem
Implement Directory Iterator.
## Implement Locale sensitive Date-Time Form Widgets
ICU provides good features for parsing and formatting
dates and times, implement Date-Time Widget
for this purpose.
It is not so-straightforward as user should know the
format he/she enters the data, such information
is not supplied by any existing widgets.
Think what to do in case of no-icu builds.
## Replace LRU with 2Q scan resistant algorithm
Check possibility of changing this.
## Degraded Mode of work
Problem:
What happens when one of cache/session servers fails?
Solution:
Provide automatic servers fail-detection procedures and continue to work in degraded mode.
## Implement Connection Forwarding over unix-sockets
CppCMS forwarding framework allows to forward any connection
to other network node over SCGI API.
Is is very useful to be able to forward connections
between forked processes of same application.
It can be done in much cheaper between forked processes
by forwarding a file descriptor over Unix domain socket and
passing already read information via shared memory.
----
← [Plugin Architecture][prev]
| [Top](#maincontent)
| [Internals of CppCMS 1.x.x][next] →
[prev]: /wikipp/en/page/cppcms_1x_plugin_architecture
[next]: /wikipp/en/page/cppcms_1x_internals
<h1>include <iostream></h1> <h1>include <string></h1> <h1>include <cstring></h1>

include <sys/socket.h>

include <netinet/in.h>

include <unistd.h>

int main() { int server_fd, client_fd; struct sockaddr_in address; int addrlen = sizeof(address);

// HTML content to be served
std::string html = 
    "HTTP/1.1 200 OK\r\n"
    "Content-Type: text/html\r\n\r\n"
    "<!DOCTYPE html>"
    "<html>"
    "<head><title>My C++ Web</title></head>"
    "<body><h1>Welcome to a Simple Web Page!</h1><p>This is served from C++.</p></body>"
    "</html>";

// Create socket
server_fd = socket(AF_INET, SOCK_STREAM, 0);
if (server_fd == 0) {
    perror("socket failed");
    exit(EXIT_FAILURE);
}

// Bind
address.sin_family = AF_INET;
address.sin_addr.s_addr = INADDR_ANY;
address.sin_port = htons(8080);

if (bind(server_fd, (struct sockaddr *)&address, sizeof(address)) < 0) {
    perror("bind failed");
    exit(EXIT_FAILURE);
}

// Listen
if (listen(server_fd, 3) < 0) {
    perror("listen");
    exit(EXIT_FAILURE);
}

std::cout << "Server is running on http://localhost:8080" << std::endl;

while (true) {
    // Accept client
    client_fd = accept(server_fd, (struct sockaddr *)&address, (socklen_t*)&addrlen);
    if (client_fd < 0) {
        perror("accept");
        exit(EXIT_FAILURE);
    }

    char buffer[3000] = {0};
    read(client_fd, buffer, 3000);  // Read client request

    std::cout << "Request:\n" << buffer << std::endl;

    // Send response
    send(client_fd, html.c_str(), html.size(), 0);
    close(client_fd); // Close connection
}

return 0;

}

<h1>include <iostream></h1> <h1>include <string></h1> <h1>include <cstring></h1>

include <sys/socket.h>

include <netinet/in.h>

include <unistd.h>

int main() { int server_fd, client_fd; struct sockaddr_in address; int addrlen = sizeof(address);

// HTML content to be served
std::string html = 
    "HTTP/1.1 200 OK\r\n"
    "Content-Type: text/html\r\n\r\n"
    "<!DOCTYPE html>"
    "<html>"
    "<head><title>My C++ Web</title></head>"
    "<body><h1>Welcome to a Simple Web Page!</h1><p>This is served from C++.</p></body>"
    "</html>";

// Create socket
server_fd = socket(AF_INET, SOCK_STREAM, 0);
if (server_fd == 0) {
    perror("socket failed");
    exit(EXIT_FAILURE);
}

// Bind
address.sin_family = AF_INET;
address.sin_addr.s_addr = INADDR_ANY;
address.sin_port = htons(8080);

if (bind(server_fd, (struct sockaddr *)&address, sizeof(address)) < 0) {
    perror("bind failed");
    exit(EXIT_FAILURE);
}

// Listen
if (listen(server_fd, 3) < 0) {
    perror("listen");
    exit(EXIT_FAILURE);
}

std::cout << "Server is running on http://localhost:8080" << std::endl;

while (true) {
    // Accept client
    client_fd = accept(server_fd, (struct sockaddr *)&address, (socklen_t*)&addrlen);
    if (client_fd < 0) {
        perror("accept");
        exit(EXIT_FAILURE);
    }

    char buffer[3000] = {0};
    read(client_fd, buffer, 3000);  // Read client request

    std::cout << "Request:\n" << buffer << std::endl;

    // Send response
    send(client_fd, html.c_str(), html.size(), 0);
    close(client_fd); // Close connection
}

return 0;

}


Navigation

Main Page


Valid CSS | Valid XHTML 1.0