Session 10: Practicing with client and servers - myTeachingURJC/2018-19-PNE GitHub Wiki
- Goals:
- Practicing with clients and servers
- Practicing with concepts introduced in previous sessions
- Duration: 2h
- Date: Week 5: Wednesday, Feb-20th-2019
Contents
Practice 3
- Place all the files in your P3 Folder in your 2018-19-PNE repo in github
- Design a Server for performing operations on a sequence: total length, finding the number of a base and the percentage of a base in the sequence
- The client could ask the server to perform many operations with one request
- The client send a request message that is a string, divided into lines separated by '\n'
- if the first line is blank (the null string "") the client wants to ask the server if it is alive. The server will response with a message with the work "ALIVE"
- The firs line (when not blank) should contain the sequence that will be used for the calculations
- The next lines indicate the operation that we want the server to perform:
- len: calculate the sequence length
- complement: Calculate the complement
- reverse: Calculate the reverse sequence
- countA : Calculat the number of A bases in the sequence
- countT : Idem for T
- countG : Idem for G
- countC : Idem for C
- percA : Calculate the percentage of A bases in the sequence
- percT : Idem for T
- percG : Idem for G
- percC : Idem for C
- The server will generate a response that is also divided in lines:
- The first line will have the ALIVE word if the first line of the request was blank, or ERROR if the received sequence is NOT valid (For example if it contains characters different than A,C,T,G (a,c,t,g are also valid)). The the sequence is ok, it will contain the OK workd
- The next lines will have the answer to the given operations, or ERROR in case the operation is unknown
As an example, if the client send the following request message:
AACT
len
complement
The server will return the following response:
OK
TTGA
More examples:
ACFGA
len
countA
Error
Authors
-
Juan González-Gómez (Obijuan)
Credits
- Alvaro del Castillo. He designed and created the original content of this subject. Thanks a lot :-)