- else if( strcmp(cmd, "request") == 0 ) {
- //const char *addr = strtok(NULL, " ");
+ else if( strcmp(cmd, "tcp_echo_server") == 0 ) {
+ const char *port_str = strtok(NULL, sep);
+ char *end;
+ int port = strtol(port_str, &end, 0);
+ if(*end != '\0') {
+ fprintf(stderr, "ERROR: Port number '%s' not valid\n", port_str);
+ continue ;
+ }