void initMessageQ()
Initialize message Queue
void freeMessageQ()
Free message Queue resource
struct _message copy_message(struct _message message)
Return copied message
message - Message to copy
RETURN - Copied message
int sendMessageToAllFollower(struct _message message)
Send to all connected follower
message - Message to send
RETURN - 0 or -2(Failure)
int sendMessageToFollower(struct _message message)
Send to specific follwer
message - Message to send
RETURN - 0 or -2(Failure)
int sendMessage(struct _message message, char send_type)
Send Message
message - Message to send
send_type - Send type (MULTICAST, UNICAST)
RETURN - 0 or -1(Failure)
int messageLength(char *message)
Return message length
message - Message to send
RETURN - length of message
int isEmpty(int thing_id)
Check if message queue is empty
thing_id - Thing number
RETURN - TRUE if empty, FALSE if not empty
int isFull(int thing_id)
Check if message queue is full
thing_id - 사물의 번호
RETURN - TRUE if full, FALSE if not full
int push(struct _message message, int thing_id)
Add message to message-queue of a thing
message - Message to add
thing_id - Thing number
RETURN - Success-1
int receiveMessage(int thing_id, struct _message *message)
Receive message from other things
thing_id - Thing number
message - Message information
RETURN - Success-1, Failure-0
struct _message pop(int thing_id)
Get the message from message-queue of thing
thing_id - Thing number
void printMessage(struct _message message)
Print message to screen
message - Message to send or receive
void printMessagePath(struct _message_path mp)
Print message forwarding path
mp - Message forwarding path