ultrafeel / hello_socket Goto Github PK
View Code? Open in Web Editor NEWTwo programs (the client and the server) for execution of a remote command and return of results: The client unites to the server then accepts from the user a command and its parameters in the form of a line of characters and parameters of a command which are required to be executed on the remote computer. After input of a command by the user, the client sends it on the server and accepts back result of command execution which the server shall return. In the server there shall be no restriction for the number of the connected clients (i.e. greatest possible for the selected protocol and the server). The server shall be realized by two methods: as the multiprocess (Option A) program (the server is several processes) or as multicontinuous (Option B) (the server - one process within which several flows work). The operation option choice the A or B server shall be carried out by reading of parameter from command line in case of start of the program. For example "server - process" - start in A operation mode, "server - pthreads" - start in B operation mode. The TCP port on which the server expects connection shall be set in case of compilation through the directive #define in the heading file.