hannushka / news_system_project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CPP 2005 Project, Communication Classes
---------------------------------------

- This directory contains the communication classes Connection and Server,
  and the auxiliary classes ConnectionClosedException and Protocol. These
  classes are defined in the project description, sections 5.2 and 6.
- 'make' makes the library libclientserver.a.
- The subdirectory 'test' contains the test programs myclient and myserver,
  as defined in the project description, section 5.3.
- 'make' makes the executables myclient and myserver.


How to run the program:

cd src
make all
make install
cd ../bin

In one terminal window:
- ./news_server <port-number>
In another terminal window:
- ./news_client localhost <port-number>

Newsclient commands:
cn name 				//creates newsgroup with the name "name"

ls					//lists all newsgroups

ca 1 Hej Einar Hej, jag heter Einar 	//creates an article in newsgroup with 
					//id: 1, title: "Hej", author: "Einar"
					//and text: "Hej, jag heter Einar"

da 1 2					//deletes article with id: 2 
					//from newsgroup with id: 1

dn 1					//deletes newsgroup with id: 1

la 1					//lists all articles in newsgroup with id: 1

ra 1 2					//reads the title, author and text from
					//article with id: 2 and newsgroup with id: 1

help					//lists all above commands




Pattern of the newsgroup info file:
<number of newsgroups>
<current ng_id>
<ng_name> <ng_id>
<ng_name> <ng_id>
<ng_name> <ng_id>
...


Pattern of the article info file:
<number of articles>
<current art_id>
<art_name> <art_id>
<art_name> <art_id>
<art_name> <art_id>
...




About


Languages

Language:C++ 92.2%Language:Makefile 4.6%Language:C 2.4%Language:Objective-C 0.9%