DebugServer2
Loading...
Searching...
No Matches
Headers
DebugServer2
Host
POSIX
HandleChannel.h
1
// Copyright 2022 Saleem Abdulrasool <compnerd@compnerd.org>
2
3
#pragma once
4
5
#include "DebugServer2/Host/Channel.h"
6
7
namespace
ds2 {
8
namespace
Host {
9
10
class
HandleChannel
:
public
Channel
{
11
int
fd_;
12
13
public
:
14
HandleChannel
() : fd_(-1) {}
15
HandleChannel
(
int
fd);
16
~HandleChannel
()
override
;
17
18
HandleChannel
(
const
HandleChannel
&) =
delete
;
19
HandleChannel
(
HandleChannel
&&other) : fd_(other.fd_) {
20
other.fd_ = -1;
21
}
22
23
public
:
24
void
close()
override
;
25
26
public
:
27
bool
connected()
const override
{
return
fd_ >= 0; }
28
29
public
:
30
bool
wait(
int
ms = -1)
override
;
31
32
public
:
33
ssize_t send(
void
const
*buffer,
size_t
length)
override
;
34
ssize_t receive(
void
*buffer,
size_t
length)
override
;
35
};
36
37
}
38
}
ds2::Host::Channel
Definition
Channel.h:18
ds2::Host::HandleChannel
Definition
HandleChannel.h:10
Generated by
1.12.0