diff --git a/y_socket_t/include/y_socket_t/y_list_var_tool.h b/y_socket_t/include/y_socket_t/y_list_var_tool.h index 0ec0893..4dbf923 100644 --- a/y_socket_t/include/y_socket_t/y_list_var_tool.h +++ b/y_socket_t/include/y_socket_t/y_list_var_tool.h @@ -41,4 +41,6 @@ size_t total_size_list_y_ptr_STRING(struct main_list_y_ptr_STRING *mstr); size_t copy_list_y_ptr_STRING_to_one_string(char **p_dst_str, struct main_list_y_ptr_STRING *mstr); struct main_list_y_ptr_STRING * split_str_to_main_list_y_ptr_STRING(char *str_org, char sep, size_t limit_size_str_org); +void usage_cmdl(); + #endif /* Y_PTR_VAR_TOOL_H__C */ diff --git a/y_socket_t/src/y_socket_t/y_list_var_tool.c b/y_socket_t/src/y_socket_t/y_list_var_tool.c index 95a4bb6..3e1a482 100644 --- a/y_socket_t/src/y_socket_t/y_list_var_tool.c +++ b/y_socket_t/src/y_socket_t/y_list_var_tool.c @@ -164,3 +164,22 @@ struct main_list_y_ptr_STRING * split_str_to_main_list_y_ptr_STRING(char *str_or return m_str; } +void usage_cmdl(){ + printf("usage:\n" + "sendto [addr] { \"cmd\" : \"[command]\" }\n" + "addr: ipv4 address or ipv6 address or all to send cmd to all nodes already in the list.\n" + "command: \n" + "\tupdate kill: to gracefully shutdown socket server.\n" + "\tupdate standby: to suspend all workers, but can receive all task but in queu tasks.\n" + "\tupdate wakeup: to wakeup all workers, and then execute all tasks in queu.\n" + "\tupdate remove node [addr]: to remove [addr] in the list.\n" + "\tupdate add node [addr]: to add [addr] in the list.\n" + "\tget file [filename]: to ask server to send file named [filename].\n" + "\t\tfilename can be absolute path or relative working directory path\n" + "\tpost file [filename] : to send file [filename] after header.\n" + "\t\tNeed to add \"seq\" and \"tm\" keys to have good handling, the payload is after the header {}\n" + "\t\tSee y_socket_send_file_for_node function.\n" + "\tpost ok [filenameid]: to acknowledge receipt [filename].\n" + "\t\t[filenameid] is to precise witch [filename] (file name from whom and when)\n" + ); +} diff --git a/y_socket_t/src/y_socket_t/y_socket_t.c b/y_socket_t/src/y_socket_t/y_socket_t.c index 2b6d833..3b20c4b 100644 --- a/y_socket_t/src/y_socket_t/y_socket_t.c +++ b/y_socket_t/src/y_socket_t/y_socket_t.c @@ -383,6 +383,7 @@ void handle_buf_socket_rec(struct main_list_y_ptr_HEADER_T *m_ok_head_l_t, struc } void *y_socket_poll_fds(void *arg){ + usage_cmdl(); struct y_socket_t * argSock = (struct y_socket_t*)arg; // // // struct main_list_ptr_y_WORKER_T * workers = create_var_list_ptr_y_WORKER_T();