mirror of
https://github.com/debauchee/barrier.git
synced 2024-12-26 20:53:22 +03:00
ed8ed72f26
init() it while it's already running. fixed an uninitialized pointer bug in CServer and some cleanup-on-error code in CMSWindowsPrimaryScreen. also added timeout to read() on IInputStream and a heartbeat sent by clients so the server can disconnect clients that are dead but never reset the TCP connection. previously the server would keep these dead clients around forever and if the user was locked on the client screen for some reason then the server would have to be rebooted (or the server would have to be killed via a remote login).
32 lines
873 B
C++
32 lines
873 B
C++
#ifndef IINPUTSTREAM_H
|
|
#define IINPUTSTREAM_H
|
|
|
|
#include "IInterface.h"
|
|
#include "BasicTypes.h"
|
|
|
|
class IInputStream : public IInterface {
|
|
public:
|
|
// manipulators
|
|
|
|
// close the stream
|
|
virtual void close() = 0;
|
|
|
|
// read up to maxCount bytes into buffer, return number read.
|
|
// blocks if no data is currently available. if buffer is NULL
|
|
// then the data is discarded. returns (UInt32)-1 if there's
|
|
// no data for timeout seconds; if timeout < 0 then it blocks
|
|
// until data is available.
|
|
// (cancellation point)
|
|
virtual UInt32 read(void* buffer, UInt32 maxCount, double timeout) = 0;
|
|
|
|
// accessors
|
|
|
|
// get a conservative estimate of the available bytes to read
|
|
// (i.e. a number not greater than the actual number of bytes).
|
|
// some streams may not be able to determine this and will always
|
|
// return zero.
|
|
virtual UInt32 getSize() const = 0;
|
|
};
|
|
|
|
#endif
|