Brief description of class still missing. More...
#include <CubeTcpServer.h>
Public Member Functions | |
| CubeTcpServer () | |
| void | sendState () |
| void | setDevice (CubeDevice *d) |
Protected Member Functions | |
| virtual TcpClientStream * | createClientStream (int fileDescriptor, const Address &peer) |
Brief description of class still missing.
Full description of class still missing
Description of constructor still missing
References TRACE.
: TcpServerStream() { TRACE; _device=0; }
| TcpClientStream * CubeTcpServer::createClientStream | ( | int | fileDescriptor, |
| const Address & | peer | ||
| ) | [protected, virtual] |
Implements GpCoreTools::TcpServerStream.
References TRACE.
{
TRACE;
return new CubeTcpStream(_device, this, fileDescriptor, peer);
}
| void CubeTcpServer::sendState | ( | ) |
References CubeDevice::isConnected(), CubeDevice::isRunning(), CubeDevice::runningTime(), GpCoreTools::TcpServerStream::send(), and TRACE.
Referenced by CubeTcpBuffer::bytesAvailable(), and CubeDevice::~CubeDevice().
{
TRACE;
if(_device->isRunning()) {
char buf[64];
snprintf(buf, 64, "state=recording %lu s\n", _device->runningTime());
send(buf, strlen(buf));
} else if(_device->isConnected()) {
send("state=stopped\n", 14);
} else {
send("state=disconnected\n", 19);
}
}
| void CubeTcpServer::setDevice | ( | CubeDevice * | d | ) | [inline] |
Referenced by CubeDevice::CubeDevice().
{_device=d;}