Network Programming

Homework 6
Frequently Asked Questions

Question:  How do I create a server that runs in the foreground?
Answer:  Compile the server with the flag -DRPC_SVC_FG. Here is a copy of a sample Makefile that does this:

.c.o:
        gcc -c -Wall -DRPC_SVC_FG $<

all: client server


client: hw6client.o hw6_clnt.o hw6_xdr.o
        gcc -o client hw6client.o hw6_clnt.o hw6_xdr.o -lnsl


server: hw6service.o hw6_svc.o hw6_xdr.o
        gcc -o server hw6service.o hw6_svc.o hw6_xdr.o -lrpcsvc -lnsl

hw6.h: hw6.x
        rpcgen -C hw6.x

clean: 
        rm *.o hw6.h hw6_svc.* hw6_clnt.* hw6_xdr.*

hw6client.c: hw6.h
hw6service.c: hw6.h

 
Question:  My code runs great until the number of records int the database gets large (more than 10). What's up with that?
Answer:  Make sure you are using TCP. UDP messages (a single UDP message is used to hold each request and response) are limited in size.