You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a simple TCP server written from scratch in C. It is a simple server that listens on a port and echos back whatever it receives.
4
+
5
+
I've followed the tutorial at [Beej's Guide to Network Programming](https://beej.us/guide/bgnet/html/multi/index.html) to gain an understanding of sockets before writing this server.
6
+
7
+
Note that currently it only supports one client. Will probably learn and implement an event loop kind of thing to support multiple clients.
8
+
9
+
## How to run
10
+
11
+
1. Clone the repository
12
+
13
+
2. Compile client and server programs (don't worry, there's a Makefile to do this for you)
14
+
15
+
```bash
16
+
make
17
+
```
18
+
19
+
3. Run the server (it will run on port 3000)
20
+
21
+
```bash
22
+
./bin/server
23
+
```
24
+
25
+
4. Run the client in another terminal
26
+
27
+
```bash
28
+
./bin/client
29
+
```
30
+
31
+
5. Type something in the client terminal and press enter. You should see the server echoing back what you typed.
0 commit comments