Implement a simple logging service

Assignment Help Programming Languages
Reference no: EM132292143

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: EM132292143

Questions Cloud

Create a void method and call it from main : Let's create a void method and call it from main. Here is what to do.
Determine the value of its customer information database : Explain, using an example, how an organisation could determine the value of its customer information database.
Identify the communication style and conflict style : Write a five page paper (cover page, at least three full pages of content, and a reference page). You will identify your communication style, conflict style.
Task and the person performing the task : One of the characteristics of information is its appropriateness to the task and the person performing the task.
Implement a simple logging service : 300698 Operating Systems Programming - Western Sydney University - Practical Case Study C - implement a simple logging service built on top of a message queue
Determine the most viable target market for pinkberry : Determine the most viable target market for Pinkberry using the bases of segmentation to describe the customer profile. Provide a rationale for your answer.
What are the quality measures : What are the quality measures?
Name of the groups : What powershell script would I need to use to create a group for the 3 Ou's (Finance, Marketing, and Sales) The name of the groups must be the same name
Characteristics versus other buying behaviors and structures : Business-to-Business ("B2B") purchasing has different procurement characteristics versus other buying behaviors and structures.

Reviews

len2292143

4/24/2019 3:00:02 AM

the first 2 pages is the questions to the assignment, there is also sample code provided which will help. We need to use the sample-code too. the assignment isn''t long i just don''t have time i want around 8/10 for the assignment

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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