To be written in C/C++ cross platform with Linux and Windows.
Use only Standard cross platform Socket implementation. NO BOOST or other third party libraries!!!
Deliver source code and make files for 32bit RHEL 5 update 3 using gcc 4.1.2 32 and 32bit Windows 2003 enterprise edition.
Overview:
This server will serve Unique id blocks to clients who request them by connecting to a listening server socket and sending an ascii encoded integer indicating the number of id’s in the block. The server will receive this integer, and send its current id to the client. The client will use this id as the first in its sequential block. The UniqueIdServer must then take its current unique id and increment it by the number of id’s requested by the client.
On start up read from a file, in ASCii format, a six digit base 36 number. Use the chars 0-1 and a-z to represent the digits in this number. The first number in the series sent should be zero and all numbers should be zero padded. For example…
first request for 10 ids.
Receive “10\n??
Send “000000\n??
Second request for 10 ids.
Receive “10\n??
send “00000a\n??
and so on…
Each time you send out a new id you should update the file with your current id. If this winds up being a performance bottle neck we can alternately just write out the number to the when you shut down. The file will consist of a single line containing only your current id followed by a new line.