![]() |
Members | Description | ||
server | ||||
socket | ||||
stm |
Objected wrapped around the socket to communicate with the server
|
|||
Worker |
Constructor. Initializes the server, socket, and creates a
NetworkStream to communicate with the client.
|
|||
run |
Method called by Network object to start processing client's
request and record the vote via initialized socket.
|
|||
processCandidatesRequest |
Process the message with <c>QUERY_CANDIDATES</c> request type, and
name of election, checks if this election exists, and responds
with the list of candidates. If the election is not defined or
closed, <c>BAD_ELECTION</c> message is sent back to the client.
|
|||
processVoteRequest |
Process the message with <c>SEND_VOTE</c> request type,
name of election, and the vote. Casts the vote and sends the
<c>ACK_VOTE</c> message back to the client. If the election is
closed, doesn't exist, or the candidate is not part of the list,
an error message is sent back to the client
|