Refactor of repo structure
FIN: Queues
Queues can now be toggled at will, if queues are not enabled then to
recieve messages the programmer must use cfetch which will return a
pointer to the latest smsg.
Note this can only be toggled once (at the start), i will add a cleanup
feature in the next patch that will allow the switching between the two
WIP: Threads Completed
Next I will be adding the ability to toggle the use of the queues, this
will be a nice feature, as it means you can either work with a pure fifo
socket basic socket approach. Or you can activate the queue system and
get fifo based on the tag of a message.
Note when using this library you must now link in pthreads when
compiling.
WIP: Threads
Started adding worker functions for threads, need to implement thread
locks to maintain thread safety.
For this we need to have locks for individual queus (locks based on
tags) to allow different tagged messages to be added to thier queues at
the same time.
I also need to implement thread safety for the connected array which
contains information on currently connected sockets.
WIP: Queues
Added basic queue helper functions. By default we have space for 256
seperate tags (each tag has its own queue). Reason for 256 is that is
how much a byte can represent, and our tag is only a byte big.
TEST: Added build for test
NOTE - The test script hardly exists, currently it just runs the c test
programs. No expected output is check. TODO: Check expected output.
Slight change to makefile
REFACTOR: Big refactor of codebase
Simplified the creation of a server and the connecting of a client.
Library now has all the tools to do basic message passing between
sockets.
Next I implement queues.
FIX: Fixed issue with printing msg.
Always add a null term to recieved data, hence if we are working with a
string we may just print etc. If we are working with anything other than
a string then we must use the len in the struct to chop off the null
term.
This is just a quaility of life feature.
WIP: Message Framework.
The message framework is now basically in place, for sending messages we
use csend, and recieve we use crecv. It has greatly simplified things,
as we now only need to pass the relivent struct to the call we are
attempting to make.
Next we shall implement the queue.
WIP: Return to byte processing
WIP: Message Passing
Basic message passing working now.
We now need to implement a slave thread on the master that deques
messages on the sockets and enques them.
WIP: message delivery
Currently having an issue converting an int to bytes, resulting in
incorrect offsets, this must be fixed before I can implmenet the threads
and queues.
In short, fix functions
- bytes_to_int
- int_to_bytes
For the above we must take into account endiance