- Handles the TCP connection and sending data
- Listens for user input from
STDINusing notifier
-
The client is created.
- Creating a notifier for user inputs
- A socket notifier is set up on
STDIN(read events). - connecting TCP socket connection signals to slots for debugging and recovery
- connecting TCP socket data ready signal to
onServerResponseslot - connecting notifier signal to
onUserInputslot
-
The client attempts to connect to the server.
- Server address is set to
localhostand the port is taken fromcommon.h.
- Server address is set to
-
The
onUserInputslot- reads a line.
- sends it to the Server using
sendDatamethod.
-
The
sendDatamethod- if connected, send command directly to Server.
- else, buffer the command into the Queue and try to connect again.
- Once connected, any buffered commands are flushed and sent in order.