Homework 2 forum

Clarifications on CLI and handlers

 
Picture of Olivér Facklam
Clarifications on CLI and handlers
by Olivér Facklam - Sunday, 15 November 2020, 15:39
 

Hello,

I have two questions:

1/ regarding the CLI, there is a note in the homework description stating the client should exit with a status code of 1 if a bad combination of parameters is given. However this doesn't seem to be implemented in the cli's main() function. Are we supposed to add this, or is it ok with the current implementation? Also should all CLI messages still go to "/message"?

2/ I noticed there is no handler defined for DataReply and SearchReply packet... can / should we add these in ourselves?

Thanks a lot, and have a nice weekend

Olivér

profile
Re: Clarifications on CLI and handlers
by Kirill Nikitin - Sunday, 15 November 2020, 18:22
 

Hi,

1) It is ok with the current implementation. And yes, it should go to "/message"; you can see in controller.go that it expects the download and search-related requests there.

2) Yes, you should add / implement them. We probably forgot to add the placeholders...

Best,

Kirill

Picture of Clément Luc Irénée Blaudeau
Re: Clarifications on CLI and handlers
by Clément Luc Irénée Blaudeau - Monday, 16 November 2020, 14:58
 

I'm still a bit confused by what we are supposed to do with the CLI. Isn't already completed in the template? What changes to the sendMsg are we suppose to make ? I'm sorry if it is obvious but I've been reading again and again the handout and I'm still lost.

profile
Re: Clarifications on CLI and handlers
by Kirill Nikitin - Monday, 16 November 2020, 16:25
 

If your sendMsg was working correctly before, I believe you do not need to make any changes because the new cli additions reuse the same packet logic. Essentially, you just need to make sure that the cli commands from the handouts work.

Kirill