mirror of
https://github.com/autc04/Retro68.git
synced 2024-09-07 13:54:33 +00:00
30 lines
493 B
C++
30 lines
493 B
C++
#pragma once
|
|
|
|
#include <Stream.h>
|
|
#include <OpenTransport.h>
|
|
#include <stdint.h>
|
|
|
|
class OpenTptStream : public Stream
|
|
{
|
|
static const long kReadBufferSize = 4096;
|
|
uint8_t readBuffer[kReadBufferSize];
|
|
|
|
bool connected = false;
|
|
|
|
TEndpoint *listenerEndpoint;
|
|
TEndpoint *endpoint;
|
|
TCall call;
|
|
|
|
void tryListening();
|
|
void tryReading();
|
|
public:
|
|
virtual void write(const void* p, size_t n) override;
|
|
|
|
void idle();
|
|
|
|
OpenTptStream();
|
|
~OpenTptStream();
|
|
};
|
|
|
|
|