|
| Connection (trikScriptRunner::TrikScriptRunner &trikScriptRunner, const QString &configVersion) |
| Constructor. More...
|
|
void | sendMessage (const QString &message) |
| Writes a given message to inner socket. More...
|
|
| Connection (Protocol connectionProtocol, Heartbeat useHeartbeat) |
| Constructor. More...
|
|
bool | isConnected () const |
| Returns true if socket is opened or false otherwise. More...
|
|
bool | isValid () const |
| Checks if socket is valid or not Attention!!! Hot fix for NTI contest. More...
|
|
QHostAddress | peerAddress () const |
| Returns peer address of a connection, if it is open, or empty QHostAddress if connection is not established yet. More...
|
|
int | peerPort () const |
| Returns peer port of a connection, if it is open, or -1 if connection is not established yet. More...
|
|
Q_INVOKABLE void | init (qintptr socketDescriptor) |
| Creates socket and initializes incoming connection, shall be called when Connection is already in its own thread. More...
|
|
Q_INVOKABLE void | send (const QByteArray &data) |
| Sends given byte array to peer. More...
|
|
Class that serves one client of TrikCommunicator.
Meant to work in separate thread. Creates its own socket and handles all incoming messages, calling ScriptRunnerWrapper for brick functionality.
Connection accepts commands:
- file:<file name>="">:<file contents>=""> — save given contents to a file with given name in current directory.
- run:<file name>=""> — execute a file with given name.
- stop — stop current script execution and a robot.
- direct:<command> — execute given script without saving it to a file.
- keepalive — do nothing, used to check the availability of connection.