Application to demonstrate what was learned during Operational Systems classes with Herbert Rocha.
This application connects client and server using a socket, and a terminal to the server using a pipe. The client can pass commands to execute on the server's terminal, and then the output will be received by the client. It is similar to a chat app.
Made by Eduardo Henrique, Rosialdo Vidinho and Venícius Jacob.
Status | Goal | Description |
---|---|---|
✅ | Support logging | use --log to log to an specified file |
✅ | Support host change | use --host to change default host |
✅ | Support port change | use --port to change default port |
✅ | Support data compression | use --compress to compress data |
✅ | Support multiple clients |
- We don't know how to pass the signal, although killing the process is fairly easy;
- First command from client always comes with some weird characters
Solution:
We don't know exactly what changed, but it suddenly works. Even though fflush(stdin) is there, it was always there to begin with, so it's weird that now it simply works.
- Can only read either first or last line from pipe output
Solution:
Change a line to line approach using fgets() to a read the file as a whole approach using fread().
- Using popen() instead of forking (requested by professor)
Implemented a solution using fork(), pipe() and execl(). To get output from execl, dup2() was used;
- Can't use any command that requests user input, e.g., htop and sudo (if not root);
- Passing SIGINT signal from client to server to kill terminal process in pipe;
- There is a limit to the number of clients that the server can support at once.