1 //===-- SBCommunication.h ---------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLDB_SBCommunication_h_
11 #define LLDB_SBCommunication_h_
13 #include "lldb/API/SBDefines.h"
14 #include "lldb/API/SBError.h"
22 eBroadcastBitDisconnected = (1 << 0), ///< Sent when the communications connection is lost.
23 eBroadcastBitReadThreadGotBytes = (1 << 1), ///< Sent by the read thread when bytes become available.
24 eBroadcastBitReadThreadDidExit = (1 << 2), ///< Sent by the read thread when it exits to inform clients.
25 eBroadcastBitReadThreadShouldExit = (1 << 3), ///< Sent by clients that need to cancel the read thread.
26 eBroadcastBitPacketAvailable = (1 << 4), ///< Sent when data received makes a complete packet.
27 eAllEventBits = 0xffffffff
30 typedef void (*ReadThreadBytesReceived) (void *baton, const void *src, size_t src_len);
33 SBCommunication (const char * broadcaster_name);
43 static const char *GetBroadcasterClass();
45 lldb::ConnectionStatus
46 AdoptFileDesriptor (int fd, bool owns_fd);
48 lldb::ConnectionStatus
49 Connect (const char *url);
51 lldb::ConnectionStatus
61 SetCloseOnEOF (bool b);
66 uint32_t timeout_usec,
67 lldb::ConnectionStatus &status);
70 Write (const void *src,
72 lldb::ConnectionStatus &status);
81 ReadThreadIsRunning ();
84 SetReadThreadBytesReceivedCallback (ReadThreadBytesReceived callback,
85 void *callback_baton);
90 DISALLOW_COPY_AND_ASSIGN (SBCommunication);
92 lldb_private::Communication *m_opaque;
99 #endif // LLDB_SBCommunication_h_