I have a client, and it's basically a potato client. What I mean by that is it's code is something like this: (This is a junky version of the code, just to make a point)
str input; str output; int inputnum; int outputnum;
cout << output;
if (output == 1) {
cin << inputnum;
}
else {
cin << input;
}
What I'm trying to do is send those input variables to and take those output variables from a server that does all the game logic and the like. The game is a text-based MUD.
I've seen a million things like this:

But I don't need that sort of thing. All I need is something like this:
[Client] ←→ [Server]
Because all the logic is on the server, so it's not important to do stuff like running it through accept sockets and the like. Is there a simple way to just connect four variables two going one way and two going the other? That's all I'm trying to do, but there aren't any simple ways to do that I've seen. Here's sort of an example of the sort of thing I'd like to happen:
Client 1:
Demon HP: [####################]
You used SWORD on DEMON!
Demon HP: [##################--]
Client 2:
Demon HP: [####################]
User1 used SWORD on DEMON!
Demon HP: [##################--]
void bind/listen/accept {. . .}function that runs right away? \$\endgroup\$