17 #include <QtCore/QObject> 18 #include <QtCore/QScopedPointer> 19 #include <QtNetwork/QTcpSocket> 21 #include "connection.h" 34 Q_INVOKABLE
void connect(
const QHostAddress &targetIp,
int targetPort,
int myServerPort,
int myHullNumber);
48 void newConnection(
const QHostAddress &ip,
int clientPort,
int serverPort,
int hullNumber);
51 void connectionInfo(
const QHostAddress &ip,
int port,
int hullNumber);
54 void newData(
const QHostAddress &ip,
int port,
const QByteArray &data);
57 void processData(
const QByteArray &data)
override;
static const int port
Definition: trikCommunicatorTest.cpp:24
One connection to a client (or server) in mailbox. Supposed to be working in a separate thread...
Definition: mailboxConnection.h:26
Q_INVOKABLE void sendSelfInfo(int hullNumber)
Send our hull number. Used in response for connection request.
Definition: mailboxConnection.cpp:42
Q_INVOKABLE void connect(const QHostAddress &targetIp, int targetPort, int myServerPort, int myHullNumber)
Connect to given endpoint and send "register" command with our mailbox server port and hull number...
Definition: mailboxConnection.cpp:28
Definition: trikCommunicator.h:31
MailboxConnection()
Definition: mailboxConnection.cpp:23
void newData(const QHostAddress &ip, int port, const QByteArray &data)
Emitted when new data message received ("data" command).
void newConnection(const QHostAddress &ip, int clientPort, int serverPort, int hullNumber)
Emitted when "register" command is received.
Q_INVOKABLE void sendConnectionInfo(const QHostAddress &ip, int port, int hullNumber)
Send info about other robot: its IP, port and hull number.
Definition: mailboxConnection.cpp:36
Abstract class that serves one client of TrikServer.
Definition: connection.h:50
void connectionInfo(const QHostAddress &ip, int port, int hullNumber)
Emitted when remote robot sends info about other known robots ("connection" command).