This project is about managing a 'Message queue'
A message queue is a shared binary file where a user can
post and retrieve messages in a FIFO mode.
The structure of the message is simple.
Basically it is a linked list.
You append the message as a buffer of bytes in the format
(length)(buffer)
You retrieve the message by reading at offset 1 the pointer to the next message, retrieve the message and update the pointer to the next message Next pointer = Pointer + len(message) + sizeof(length)
that's basically it.
than you have a direct read or a read done through sockets
as well as write.
You have get and release locks to avoid mess if 2 users try to read/write at the same time.
You must provide a clean-up procedure
Basically if the size of the unused space is > than max and no more messages are in queue, you truncate the queue to zero
length.
I need a DLL written in C (pure Console no MFC) which exports the following functions
int dqOpen("QueueName")
int dqOpenSckt("QueueName","address","port")
int dqSetKey("myKey")
int dqRead(buffer) returns bytes read
int dqWrite(length,buffer)
int dqSend([login to view URL])
int dqRecv(buffer,wait)
int dqDelete("queueName")
int DqCount() returns the number of messages in the queue
int dqIsEmpty() returns -1 if empty or 0 if there are messages
(__stdcall convention for being usable also by VB)
format for binary file is
(requestCleanup)(pointerToFirstUnreadMsg)[(msglen)(message)]*
0123456789ABCDF.....
|+--+---+----------....(message)
| | +----> length of message (int)
| +--> Pointer to first unread message (unsign int)
+--> Request cleanup (x01 = cleanup requested)
I can send you a partial implementation of it for better understanding.
## Deliverables
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables):
a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment.
b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request.
3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).
## Platform
Windows 32 console
Dll
Usable by VB applications and other c programs