diff -r 06e472d3f9f8 -r ea83b9e9057f QTfrontend/tcpBase.cpp --- a/QTfrontend/tcpBase.cpp Sun Oct 01 20:31:48 2006 +0000 +++ b/QTfrontend/tcpBase.cpp Mon Oct 02 18:09:39 2006 +0000 @@ -42,7 +42,8 @@ QList srvsList; -TCPBase::TCPBase() +TCPBase::TCPBase(bool demoMode) : + m_isDemoMode(demoMode) { IPCServer = new QTcpServer(this); connect(IPCServer, SIGNAL(newConnection()), this, SLOT(NewConnection())); @@ -138,3 +139,28 @@ void TCPBase::SendToClientFirst() { } + +void TCPBase::SendIPC(const QByteArray & buf) +{ + if (buf.size() > MAXMSGCHARS) return; + quint8 len = buf.size(); + RawSendIPC(QByteArray::fromRawData((char *)&len, 1) + buf); +} + +void TCPBase::RawSendIPC(const QByteArray & buf) +{ + if (!IPCSocket) + { + toSendBuf += buf; + } else + { + if (toSendBuf.size() > 0) + { + IPCSocket->write(toSendBuf); + if(m_isDemoMode) demo->append(toSendBuf); + toSendBuf.clear(); + } + IPCSocket->write(buf); + if(m_isDemoMode) demo->append(buf); + } +}