Update some inaccuracies in markdown files
This commit is contained in:
15
design.md
15
design.md
@@ -118,7 +118,7 @@ Ultra-fast memory allocator optimized for request/response patterns:
|
||||
- **Configurable epoll instances** to eliminate kernel-level epoll_ctl contention (default: 2, max: io_threads)
|
||||
- **Round-robin thread-to-epoll assignment** distributes I/O threads across epoll instances
|
||||
- **Connection distribution** keeps accepted connections on same epoll, returns via round-robin
|
||||
- **Factory pattern construction** via `Server::create()` ensures proper shared_ptr semantics
|
||||
- **Factory pattern construction** via `Server::create()` ensures you can only get a `Ref<Server>`
|
||||
- **Safe shutdown mechanism** with async-signal-safe shutdown() method
|
||||
- **Connection ownership management** with automatic cleanup on server destruction
|
||||
- **Pluggable protocol handlers** via ConnectionHandler interface
|
||||
@@ -383,18 +383,7 @@ auto server = Server::create(config, handler);
|
||||
|
||||
#### Connection Creation (Server-Only)
|
||||
|
||||
```cpp
|
||||
// Only Server can create connections (using private friend method)
|
||||
class Server {
|
||||
private:
|
||||
auto conn = Connection::createForServer(addr, fd, id, handler, weak_from_this());
|
||||
};
|
||||
|
||||
// No public way to create connections - all these fail:
|
||||
// auto conn = Connection::create(...); // ERROR: no such method
|
||||
// Connection conn(addr, fd, id, handler, server); // ERROR: private constructor
|
||||
// auto conn = std::make_unique<Connection>(...); // ERROR: private constructor
|
||||
```
|
||||
Only Server can create connections (using private constructor via friend access)
|
||||
|
||||
### ConnectionHandler Implementation Patterns
|
||||
|
||||
|
||||
Reference in New Issue
Block a user