A text-based protocol made for CS studies at PUT
Communication between clients via the server (n: 1), based on the plain text protocol.
connectionless,
all data sent in text form (sequence of ASCII characters),
every message with a time stamp,
header element structure defined as #key#$#value#
(example) #operation#$#add#
case sensitive identification,
operation field - O,
answer field - o,
ID field - I.
additional fields defined by the programmer.
establishing a connection with the server,
obtaining a session identifier,
sending a single natural number L,
sending numeric values that are "answers": the client has to guess the number drawn by the server.
ending the call.
generating a session identifier,
drawing a secret number from the interval (L1; L2),
sending the range in which the number to be guessed is included,
informing customers whether the value was guessed.
session ID should be sent during communication,
each message sent should be confirmed by the other side.
field
key
values
Operation
O
connecting, range, guess
Response
o
L, L1:L2, win, >, <, won_player's_id, rejected
ID
I
session_id
field
key
values
Flags
f
syn, ack, push
Flag No.
n
numeric_flag_id
Time
t
timestamp
1. Client initializes connection
2. Server confirms and send session_id
3. Server sends L1, L2 data to client
4. Client confirms receiving
6. Server confirm receiving
7. Server send response to client