winpty/TestNetClient/UnixClient.h
Ryan Prichard b491fd6378 Add a UnixSignalHandler class. It emits a Qt signal when a Unix signal is
handled.

Use the UnixSignalHandler to detect terminal resizing.  The client doesn't
do anything with the terminal size yet.  It should send the size to the
server.
2011-11-24 03:03:25 -08:00

44 lines
871 B
C++

#ifndef UNIXCLIENT_H
#define UNIXCLIENT_H
#include <QObject>
#include <QByteArray>
#include <termios.h>
class QSocketNotifier;
class QTcpSocket;
class UnixClient : public QObject
{
Q_OBJECT
public:
explicit UnixClient(QTcpSocket *socket, QObject *parent = 0);
virtual ~UnixClient();
private:
static termios setRawTerminalMode();
static void restoreTerminalMode(termios original);
signals:
private slots:
void terminalResized();
void socketDisconnected();
void terminalReadActivated();
void socketBytesWritten();
void socketReadyRead();
void terminalWriteActivated();
void doServerToClient();
public slots:
private:
termios savedTermios;
QSocketNotifier *terminalReadNotifier;
QSocketNotifier *terminalWriteNotifier;
QTcpSocket *socket;
QByteArray terminalWriteBuffer;
};
#endif // UNIXCLIENT_H