1 \documentclass{article
}
4 \newenvironment{paramlist
}
5 {\begin{list
}{\bfseries\upshape \hspace{2em
}Parameter
\arabic{paramc
}:
}
6 {\usecounter{paramc
}\setlength{\parsep}{0.0ex
}\setlength}}
9 \newcommand{\ipcmsg}[1]{{\raggedleft\bfseries\upshape #1}}
15 When describing the comunication examples between two process we will
16 define one process as a client (requesting a service) as the server,
17 the format to describe a message will be the following:
20 C: message name: parameter
1 ; parameter
2 ; parameter
3
21 S: message name: parameter
1 ; parameter
2 ; parameter
3
24 Where C is client and S server.
26 \section{Common Messages
}
30 A positive response to another mensage, should include a return value.
44 \section{Authentication Server
}
49 Verify if a user exist, will return "ok" is the user
50 exist, error otherwise.
58 Will authenticate a given user, will return ok if the
59 user and password are right, error otherwise.
66 \section{Mail Queue Server
}
68 \subsection{Comunication Examples
}
69 \subsubsection{Adding a message to a queue
}
71 With a given queue named "incoming" we will push a message to it,
72 where C is the client and QS is the queue server:
76 QS: ok: /tmp/fmain/queues/incoming/
212214962143124030
77 C: push: incoming ; /tmp/fmain/queues/incoming/
212214962143124030
81 \subsubsection{Getting a message from a queue
}
83 With a given queue named "incoming" we will pop a message from it,
84 where C is the client and QS is the queue server:
88 QS: ok: /tmp/fmain/queues/incoming/
212214962143124030
91 \subsubsection{Subscribing to a queue
}
93 With a given queue named "incoming" we will subscribe to it,
94 where C is the client and QS is the queue server:
97 C: subscribe: incoming ; socket://
127.0.0.1:
14001
101 Once the client is subscribed and there is new messages in the queue,
102 the queue server will connect back to the client and send the message
103 "alert", then the client may pop messages till it receives the error
109 QS: ok: /tmp/fmain/queues/incoming/
212214962143124030
114 \subsection{Messages
}
118 Request a slot from the message queue, it will send
119 back an OK response with the filename to use, this
120 filename will be the identifier the requested slot.
122 After writing the data into the file you must send back
123 a the finishing message "push", in order to move the
124 message to the queue.
132 Tell the queue server that it can move a given message to
133 the queue, this means that we finished writing the data to
134 the file and it is closed.
143 Retrieve the next message in the queue, it will return an OK
144 message with the filename.
152 Subscribe to a message queue, the subscriber will receive alerts
153 when there is new messages in the queue.
157 \item IPC Callback String
162 Remove subscription to a queue. The IPC Callback String should
163 be exactly the same as given on subscription.
167 \item IPC Callback String
170 \section{Mailbox Server
}
172 \subsection{Comunication Examples
}
174 \subsubsection{Listing a user mailbox
}
176 Give a mailbox server MS and a client C:
181 MS: mailinfo:
1 ;
120
182 MS: mailinfo:
2 ;
300
186 \subsection{Messages
}
190 It will return ok message with the amount of emails
191 for a given user, after that it will push n "mailinfo"
192 message. On failture it will return error.
200 Return message with a given email detail.
204 \item Message Size (in octets)
209 Store an email, it will return ok if successful and
210 begin using raw operations till read 'Data Length'
221 Retrieve an email for a given user. Should
222 return ok with the size of the email if the
223 email number is valid and then it will
224 start sending the email using raw operations.
225 If the email number is invalid will return error.
234 Delete an email for a given user. It will return
235 ok if the operation was sucessful, error otherwise
236 (when the message doesen't exist.