Create a simple logging service

Assignment Help Programming Languages
Reference no: EM132294643

Practical Case Study

1 Introduction

In this case study you will implement a simple logging service built on top of a message queue.

2 Specification

The task is broken into three parts, a message logging server, a library to log messages, and a driver to test the library. You will need to review the lecture notes, and the documentation supplied in Section 5 to implement these programs.

Message Logging Server

The message logging server should attempt to create the message queue, if this fails then it should terminate with an error message, it should not run if the message queue actually exists (IPC_EXCL will help here).

Once connected to the message queue, the program should sit in a loop, receiving a mes-
sage, and printing it to the stdout. Messages should be formatted:
id: message
where id is the type from the message structure and message is the message field.

The server should shutdown cleanly (i.e. delete the message queue) on receipt of a SIGINT (generated by pressing control and C keys at the same time).

The sample code files logservice.h and logserver.c should form the basis of your solution for this part.

Messaging library
The messaging library consists of two functions, both defined in logservice.h:

int initLogService()

This function should initialise the message queue to log messages to, returning an id if successful, and -1 on error.
This function should not attempt to create the message queue, only attach it to the process.

int logMessage(int id, char *message)

This function logs the message passed as the string message to the log service id. It should return 0 on success and -1 on error.
When sending a message, the function should encode the processes pid into the type field of the message, and the string into the message field.

It is your choice what to do if the message is too long (i.e. longer than MSGCHARS), sample behaviours include breaking the message up into smaller pieces or simply rejecting it. Whatever the choice, the documentation in the header file should re2ect this choice.
The sample code files logservice.h and logservice.c should form the basis of your solution for this part.

Test Driver
This program is used to test the functionality of the library described in Section 2.2. It need not be complex, but is should be able to determine, and report if any errors have occurred.

The sample code files logservice.h and logclient.c should form the basis of your solution for this part.

Attachment:- Operating Systems Programming.rar

Reference no: EM132294643

Questions Cloud

Identify two stress management and prevention strategies : Identify two stress management and prevention strategies and examine the fundamental ways in which implementing your strategies will potentially lead.
Examine critically the four stages of the problem-solving : Examine critically the four stages of the problem-solving process (SARA) and explain the importance of each stage.
Why is cassius clay-muhammad ali so important : Drawing on all the sources below, explain the issues surrounding Muhammad Ali's "greatest fight," his refusal to be drafted for combat during the Vietnam War.
What environmental factors do you think contribute : When exploring macro level approaches to gangs, community and environmental factors play a crucial role in explaining why gangs thrive in areas.
Create a simple logging service : 300698 Operating Systems Programming - Western Sydney University - In case study you will implement a simple logging service built on top of a message queue
Define aspects that demonstrate old and new world exchanges : Determine three (3) major aspects that demonstrate Old and New World exchanges. List five (5) specific groups that were affected by this event.
Examine the principles of community policing : The effective partnership between the police and the community must also be understood to better appreciate the development and functions of police.
Which counterterrorism tactics do you think work the best : Research and discuss the effectiveness of the counterterrorism effort in the United States.
Define characteristics for each of the english colonies : Using the Webtext, briefly describe three (3) characteristics for each of the English colonies located in the south, middle, and New England regions.

Reviews

len2294643

4/27/2019 3:29:00 AM

I have an assignment which we are required to create a simple logging service buitl on top of a message queue, there is sample code provided to us to assist us but i really do need help as i am confused. We are also wondering if we can do a 2 on 1 session (me and my friend)

Write a Review

Programming Languages Questions & Answers

  Create application with a main menu containing given options

Create an application with a main menu containing the following options: This option must allow the user to see a list of all painting names with their artist name. If there are no paintings available, the user must see an error message.

  Program that creates a customised children''s story

Imagine you are writing a computer program that creates a customised children's story using names provided by the user of the program.

  Write a program that requests the number of bagels ordered

Write a program that requests the number of bagels ordered and displays the total cost. Test the program for orders of four bagels and a dozen bagels.

  Extend the adworks application

Add a button on the customer form to read and edit addresses for customers. The user should be able to select a customer and edit their address

  Program a robot to run mile-long steeplechase

Program a robot to run mile-long steeplechase where steeples are made from beepers instead of wall segmesnts. the robot must jumb the steeples in this race by picking the beepers that make up the steeples.

  Benefits of programming with objects and classes

How is it different from programming with functions alone? Write down benefits of programming with objects and classes in Web applications?

  Write pseudo algorithm which inputs age for valid voting

Write pseudo algorithm which inputs Age, displays "Yes, you can vote" if Age is 18 or older and displays "You are too young to vote" if Age is less than 18, and displays nothing else.

  What is java adapter class

What is Java adapter class.

  Determine where they fall within the model and why

Discussion: Generational Languages- Choose two other languages within your industry. Determine where they fall within the model and why.

  The formula for the area of a circle is pir2 where r is the

the formula for the area of a circle is pir2 where r is the radius of the circle. write a program to compute the area

  In what stage of the programming process are flowcharts used

In what stage of the programming process are flowcharts and pseudocode used

  Write program to accept data in array with three structures

Develop and make a program which will accept above data in array with three structures. Once data have been entered, display report listing each employee number and salary of employee.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd