[cs631apue] hw4 questions.

afonsec1 afonsec1 at stevens.edu
Mon Nov 14 11:20:09 EST 2011

On Mon, 14 Nov 2011 10:45:44 -0500, Jan Schaumann wrote:
> afonsec1 <afonsec1 at stevens.edu> wrote:
>> Can we have/allow a port number zero giving by the user?
> It'd probably be good to restrict this.  Zero is, technically, a 
> valid
> port, but its seen various uses over time / different OS.
>> When writing for the first time into the log file,  should truncate 
>> or
>> append for each session?
> If the manual page does not specify this, then this is up to you.
> Think about what would be desirable from the user's point of view.  
> What
> would make sense from the principle of least surprise?
>> If we are in debug mode but log file is giving, should we ignore the 
>> log
>> file name? or throw an error?
> This is up to you - again, think about what makes the most sense.
>> For printing usage (-h),  should always send to stdout or stderr?
> Note that it may be reasonable to have it go either way, depending on
> the reason you're printing the usage:
> If the user explicitly asks for the usage by passing '-h', then 
> stdout
> would make sense.  If the user provides illegal options, then stderr
> would make sense.
> See what other standard unix tools do and make your own choice.
>> For logging request, since we haven't implemented response, I cannot 
>> log
>> the status of the request and the size of the response?, Should I 
>> skip
>> them?
> You don't need to implement logging as part of HW#4.  That would make
> more sense to be included in the final project.
> -Jan


If we are in debug mode and therefore not daemonize, should we still 
support signal handling? should we do a restart for signal handling?

 From my understanding, when we go daemon, we close all file descriptor 
for the giving process, so if we passed a log file name, we have to open 
a descriptor to that file?

Since we close the stderr fd on daemon mode too, should we log the 
fatal messages (messages about reasons for terminating the program) on 
the syslog? or just terminate without logging the event?

I didn't specify the ai_family, so the way that I get address info is 
agnostic. Hence it really doesn't matter whether the address passed on 
the (-i) option is ipv6, or ipv4, it will recognize it dynamically. Are 
you okay with this? or do you want us to hard-code the address family?


More information about the cs631apue mailing list