The goal of this practice is to develop our own **Seq** server for working with **DNA sequences**. We have been working with DNA sequences for many sessions, but always in our local computer. Now we will make these calculations available to other applications on Internet
The first step is to **define** the set of **rules** and **commands** that the **clients** need to follow in order to access the **services** given by our **server**: we should define the **protocol**
| Service name | Request message | Argument | Response message | Description |
| **PING** | "PING" | none | "OK" | Ping service for testing if the server is alive of not |
| **GET** | "GET n" | n: 0-4 | A sequence | Get the sequence n. It could be any valid sequence of any length. There are only 5 sequences, numbered from 0 to 4 |
| **INFO** | "INFO seq" | seq: A sequence | See format below | Get information about the given sequence: total length, number of bases and their percentages |
...
...
@@ -57,7 +56,7 @@ The server will be programmed **step by step**, following the guides given in th
## Localhost IP address
There is a special **IP** address: **127.0.0.1**, which is used to identify **your local machines**. When programming a server, instead of having to used the real IP, it is** easier to use this IP. Doing so, you do not have to change the code when running the server in a different computer
There is a special **IP** address: **127.0.0.1**, which is used to identify **your local machines**. When programming a server, instead of having to used the real IP, it is\*\* easier to use this IP. Doing so, you do not have to change the code when running the server in a different computer
**We will always use the 127.0.0.1 address** in our servers
...
...
@@ -73,7 +72,7 @@ you should use the **Seq1 module** developed in **practice 1**
***Filename:** P3/Seq-Server.py
Let's start by programming a server that implements the **PING command**. The client will send a message with the word **PING**. Then, the server should **parse** the request message. If the PING command is **detected**, it should generate the response message **"OK!\n"**. Also, it should **print on the console** the message "PING command!" in GREEN, and then the response message in white
Let's start by programming a server that implements the **PING command**. The client will send a message with the word **PING**. Then, the server should **parse** the request message. If the PING command is **detected**, it should generate the response message **"OK!\\n"**. Also, it should **print on the console** the message "PING command!" in GREEN, and then the response message in white
For **testing the server** we use this command, executed from the **command line**:
...
...
@@ -89,7 +88,6 @@ And this is what we should get in the **Server's console**: