DebugServer2
Loading...
Searching...
No Matches
Channel.h
1//
2// Copyright (c) 2014-present, Facebook, Inc.
3// All rights reserved.
4//
5// This source code is licensed under the University of Illinois/NCSA Open
6// Source License found in the LICENSE file in the root directory of this
7// source tree. An additional grant of patent rights can be found in the
8// PATENTS file in the same directory.
9//
10
11#pragma once
12
13#include "DebugServer2/Types.h"
14
15namespace ds2 {
16namespace Host {
17
18class Channel {
19public:
20 virtual ~Channel() = default;
21
22public:
23 virtual void close() = 0;
24
25public:
26 virtual bool connected() const = 0;
27
28public:
29 virtual bool wait(int ms = -1) = 0;
30
31public:
32 virtual ssize_t send(void const *buffer, size_t length) = 0;
33 virtual ssize_t receive(void *buffer, size_t length) = 0;
34
35public:
36 virtual bool send(std::string const &buffer);
37 virtual bool receive(std::string &buffer);
38};
39} // namespace Host
40} // namespace ds2
Definition Channel.h:18