Click here to Skip to main content
15,909,591 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: please help me with this homework Pin
jhwurmbach1-Dec-03 2:29
jhwurmbach1-Dec-03 2:29 
GeneralRe: please help me with this homework Pin
gina781-Dec-03 2:41
gina781-Dec-03 2:41 
GeneralRe: please help me with this homework Pin
jhwurmbach1-Dec-03 2:50
jhwurmbach1-Dec-03 2:50 
GeneralRe: please help me with this homework Pin
gina781-Dec-03 2:56
gina781-Dec-03 2:56 
GeneralRe: please help me with this homework Pin
jhwurmbach1-Dec-03 3:05
jhwurmbach1-Dec-03 3:05 
GeneralRe: please help me with this homework Pin
gina781-Dec-03 3:09
gina781-Dec-03 3:09 
GeneralRe: please help me with this homework Pin
jhwurmbach1-Dec-03 3:39
jhwurmbach1-Dec-03 3:39 
GeneralRe: please help me with this homework Pin
gina781-Dec-03 3:12
gina781-Dec-03 3:12 
Initial design document


 « News service application »


1.	Program Files

q	Files common to both the client and the server

-	Makefile : Used to compile the client and the server
-	clientserver.x : RPC specification file used by rpcgen
-	clientserver.h : Header file generated by rpcgen
-	clientserver_clnt.c : Client code generated by rpgen
-	clientserver_svc.c : Server code generated by rpgen
-	clientserver_xdr.c : XDR conversion file generated by rpcgen

q	Client specific files

-	mrn.c : Client main program
-	mrn_cif.c : Client interface routines
-	mrn : Client executable

q	Server specific files

-	mserver.c : Application server code
-	mserver_sif.c : Server interface routines
-	mserver : Server executable

q	Crasher specific files

-	mcrash.c : Application crasher code
-	mcrash_cif.c : Crasher interface routines
-	mcrash : Crasher executable




2.	Makefile

#
# Makefile for news service application (conventional and RPC)
#
all :            mrn          mserver         mcrash
install :       all
                   @echo nothing to install

clean :         rm    *.o   clientserver.h   clientserver_xdr.c  clientserver_clnt.c   clientserver_svc.c  mrn  mserver
                            mcrash
#
# Dependencies for files generated by rpcgen
#
clientserver_clnt.c :      clientserver.h     clientserver.x
clientserver_xdr.c  :      clientserver.h     clientserver.x
clientserver_svc.c  :      clientserver.h     clientserver.x

clientserver.h          :      clientserver.x

                             rpcgen      clientserver.x
#
# Link client-side files for RPC version
#
mrn :   clientserver_clnt.o  mrn_cif.o   clientserver_xdr.o    mrn.o
            gcc  -o   mrn   clientserver_clnt.o   mrn_cif.o  mrn.o  clientserver_xdr.o    -lnsl
   
#
# Link server-side files for RPC version
#
mserver :  clientserver_svc.o  mserver_sif.o  mserver.o   clientserver_xdr.o 
                 gcc   -o   mserver   clientserver_svc.o  mserver_sif.o  mserver.o  clientserver_xdr.o   -lnsl

#
# Link crasher-side files for RPC version
#
mcrasher :  clientserver_svc.o  mcrasher_cif.o  mcrasher.o   clientserver_xdr.o 
            gcc   -o   mcrasher  clientserver_svc.o  mcrasher_cif.o  mcrasher.o  clientserver_xdr.o   -lnsl
 
#
# Individual object file dependencies
#
clientserver_clnt.o :  clientserver_clnt.c     clientserver.h   clientserver.x
                                               gcc  -c   clientserver_clnt.c 

clientserver_svc.o :  clientserver_svc.c     clientserver.h   clientserver.x
                                              gcc  -c   clientserver_svc.c 

clientserver_xdr.o :  clientserver_xdr.c     clientserver.h   clientserver.x
                                              gcc  -c   clientserver_xdr.c 

mrn.o :        mrn.c           clientserver.h   clientserver.x
                                        gcc  -c   mrn.c 

mrn_cif.o :  mrn_cif.c     clientserver.h   clientserver.x
                                        gcc  -c   mrn_cif.c 

mserver.o :        mserver.c           clientserver.h   clientsserver.x
                                                     gcc  -c   mrn.c 

mserver_sif.o :  mserver_cif.c     clientserver.h   clientserver.x
                                                     gcc  -c   mrn_cif.c 
mcrasher.o :  mcrasher.c         clientserver.h     clientserver.x
                                                gcc  -c    mcrasher.c

mcrasher_cif.o :  mcrasher_cif.c         clientserver.h     clientserver.x
                                                gcc  -c    mcrasher_cif.c



3.	RPC specification file

const msgstring_size = 1000;    /* maximum size of the message string */

struct message          /* structure declared here to define the message
                                     /*structure */
{       
  String usr_name;
        String msg;
        int svc_index;
        int msg_num;
        int msg_subject;
        String msg_author;
        boolean read;   /* to distinguish read pr unread messages*/
};
struct header
{
        String subject;
        String author;
};

/*-----------------------------------------------------------------------
* clntsvc_pg - program definition
 *-----------------------------------------------------------------------
 */
 program clntsvcPROG  /*    program name  */
{
        version clntsvc_pgVERS  /* declaration of version 1*/
        {
                void login(String)      = 1 ; /* First procedure  */
                void connect_svc(int)   = 2 ; /* Second procedure */
                void viewlist(void)     = 3 ; /* Third procedure  */
		void post_msg(String)   = 4 ; /* Fourth procedure */
                void delete(int)        = 5 ; /* Fifth procedure  */
                void read(int)          = 6 ; /* Sixth procedure  */
                void start_svc(int)     = 7 ; /* Seventh procedure*/
                void msg_exp(int)       = 8 ; /* Eighth procedure */
                void svc_crash(int)     = 9 ; /* Ninth  procedure */
                void clnt_crash(void)   = 10; /* Tenth procedure  */
        } = 1;                  /* Definition of the program version  */

} = 0x30090949;                /* Program number that must be unique */

	The first procedure is used to login as a user 
The second is to connect to a server.
The third procedure is to view list of available messages.
The fourth procedure is for posting messages.
The fifth procedure is for deleting messages read or unread.
The sixth procedure is for reading messages.
The seventh procedure is to start the server.
The eighth procedure is to handle the expiration of messages.
The ninth procedure is to handle crashing server.
The tenth procedure is to handle crashing client.

4.	Running the program


To start the server application, enter: mserver
To start a client application, enter: mrn [hostname]

GeneralRe: please help me with this homework Pin
gina781-Dec-03 3:14
gina781-Dec-03 3:14 
GeneralRe: please help me with this homework Pin
gina781-Dec-03 3:06
gina781-Dec-03 3:06 
GeneralVideo from camera of computer Pin
engahmadm1-Dec-03 1:02
engahmadm1-Dec-03 1:02 
GeneralRe: Video from camera of computer Pin
Ryan Roberts1-Dec-03 1:29
Ryan Roberts1-Dec-03 1:29 
GeneralVideo from camera of computer Pin
engahmadm1-Dec-03 1:01
engahmadm1-Dec-03 1:01 
GeneralCMenu modality problems Pin
Arfur1-Dec-03 0:34
Arfur1-Dec-03 0:34 
GeneralRe: CMenu modality problems Pin
Roger Allen1-Dec-03 1:39
Roger Allen1-Dec-03 1:39 
GeneralRe: CMenu modality problems Pin
Arfur9-Dec-03 22:16
Arfur9-Dec-03 22:16 
GeneralHelp me...I wanna detect my browser Pin
User 2155971-Dec-03 0:31
User 2155971-Dec-03 0:31 
GeneralRe: Help me...I wanna detect my browser Pin
David Crow1-Dec-03 3:49
David Crow1-Dec-03 3:49 
GeneralSound (again) channels Pin
DaFrawg1-Dec-03 0:21
DaFrawg1-Dec-03 0:21 
GeneralRe: Sound (again) channels Pin
KaЯl1-Dec-03 4:08
KaЯl1-Dec-03 4:08 
General.bmp/.jpeg to .pcx conversion Pin
satadru1-Dec-03 0:11
satadru1-Dec-03 0:11 
GeneralRe: .bmp/.jpeg to .pcx conversion Pin
ZoogieZork1-Dec-03 6:51
ZoogieZork1-Dec-03 6:51 
Generalif my apps trial period expired Pin
BaldwinMartin30-Nov-03 23:13
BaldwinMartin30-Nov-03 23:13 
GeneralRe: if my apps trial period expired Pin
Antti Keskinen30-Nov-03 23:29
Antti Keskinen30-Nov-03 23:29 
GeneralRe: if my apps trial period expired Pin
BaldwinMartin30-Nov-03 23:40
BaldwinMartin30-Nov-03 23:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.