I am wondering about the theoretical aspect of this. Say if I'm supposed to make something like an SSH, and I write commands on the client side. Initially I've created, bound, listened and connected sockets. Then I use the write() call for sending the command to a server.
Say ls is my command, and this is of my understanding and executable. I don't see how I can output and executable to a client, if I'm using read() on serverside and execute the ls. I can't simply store an ls in the write() call on serverside, in such a way that it on clientside could be read().