./server -p < port > -s <thread_pool_size> -q <queue_size>
<port>: port number which will be used by the socket to receive connection from clients
<thread_pool_size>: The number of working threads in the thread pool
<queue_size>: The size of the queue
For the client
./client -h <server_host> -p <server_port> -i <command_file>
<server_host>: The address (name) of the server machine
<server_port> : The port of the server, so the client can connect to it
<command_file> : The file with the commands to the server
Example
./server -s 30 -q 100 -p 9002
./client -h localhost -p 9002 -i input.txt
A thread safe circular queue has been implemented.
Message form
The message which are send between client and server use the first 4 bytes for the messageSize in bytes, 1 byte for space, and the message.
HashTable
The bankAccounts are kept in a hashTable.
BankClient
The bank client connect to the server, and reads one by one the commands from the file. The command is checked for any syntax errors and sended to the server, then the client waits for the response(success or not).
BankServer
The masterThread set up the socket. Then it creates the workerThreads and a queue for the incoming requests. For each new connection the connection is putted to the queue, a worker thread pops it out and does the commands. When it finishes it pops a new connection.
To terminate the server use control-c