#ifndef SOCKETPAIR_H #define SOCKETPAIR_H /** * Unix socketpair function emulation */ #include #include #include #include class SocketPair: public QObject { Q_OBJECT public: SocketPair(QObject *parent = 0); bool create(); void close(); QTcpSocket* input(); QTcpSocket* output(); Q_SIGNALS: void sigData(QByteArray); private slots: void newConnection(); void readServerData(); private: QTimer *dataCheck; QTcpSocket *serverConnection; QTcpSocket clientConnection; QTcpServer server; }; #endif // SOCKETPAIR_H