Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
emanuelchristo committed May 6, 2024
2 parents e58dff8 + fce9fbb commit 8d7e95c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
Binary file added docs/assets/stage-6/design.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/roadmap/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The eXpServer project comprises 24 stages, organized into 5 phases. Prior to the

### Phase 1: Building the core of eXpServer by creating reusable modules

- 🟡 [Overview](phase-1/)
- [Overview](phase-1/)
- 🟡 [Stage 6: Listener & Connection Modules](phase-1/stage-6)
- 🟡 [Stage 7: Core & Loop Modules](phase-1/stage-7)
- 🟡 [Stage 8: Non-Blocking Sockets](phase-1/stage-8)
Expand Down
14 changes: 11 additions & 3 deletions docs/roadmap/phase-1/stage-6.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
- Read about the eXpServer [Architecture](/guides/resources/architecture)
- Read the [Coding Conventions](/guides/resources/coding-conventions) for eXpServer

:::
:::

## Introduction

Expand All @@ -34,6 +34,16 @@ We will utilize _netcat_ as a client for this stage to connect to eXpServer to s

We will group listener and connection modules under the category _network_. Create a folder named `network` inside the `expserver/src` folder.

## Design

The main objective of Stage 6 is to enable eXpServer to listen on multiple ports simultaneously. This involves designing and implementing a module called `xps_listener`. Each instance of `xps_listener` module contains a socket with is bound to a specific host and port, and it is responsible for listening to incoming network connections on it.

This modularization will allow eXpServer to create multiple listeners each bound to a different ports.

When an `xps_listener` instance gets a client connection, an instance of `xps_connection` is created. `xps_connection` module is responsible for managing individual TCP connections between the server and clients. It encapsulates functionality related to creating, managing, and destroying individual connections.

![design.png](/assets/stage-6/design.png)

## Implementation

![implementation.png](/assets/stage-6/implementation.png)
Expand Down Expand Up @@ -132,8 +142,6 @@ We will be constantly modifying/adding to this file in each stage to accommodate

### `main.c`

<< line here >>

`main.c` will contain the following:

- `main()`; starting point of eXpServer. It’s main objective is to spin up listener(s) and run the event loop.
Expand Down
2 changes: 1 addition & 1 deletion docs/roadmap/phase-1/stage-7.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ With the integration of these modules, modifications to the `xps_listener` and `

![filestructure.png](/assets/stage-7/filestructure.png)

### Design
## Design

Adding to the modularization of eXpServer, in this stage, we design and implement two new modules named `xps_core` and `xps_loop`.

Expand Down

0 comments on commit 8d7e95c

Please sign in to comment.