Encapsulates a socket with asynchronous break-in support.
More...
#include <BreakInSocket.h>
|
class | SocketWrapper |
| An instance of this class should be obtained and held for the entire time when a packet is received. After it is destroyed, the break-in detector thread becomes active again. More...
|
|
Encapsulates a socket with asynchronous break-in support.
This class should be used to receive packets from GDB. The main packet handling loop should look this way:
- Create an instance of BreakInSocket::SocketWrapper
- Use SocketWrapper to get read the packet. If the first byte received from the socket is 0x03, raise the break-in event.
- If TCPSocketEx::Peek() was called, call TCPSocketEx::Discard()
- Delete the BreakInSocket::SocketWrapper instance
- Process the packet, send reply, etc.
The BreakInSocket class ensures that if a break-in request (0x03 byte) arrives while the packet is being processed (i.e. BreakInSocket::SocketWrapper not existing), a IBreakInTarget::OnBreakInRequest() will be called from a worker thread.
This allows the packet handlers to run blocking requests (e.g. 'continue') and still being able to react to the asynchronous break-in requests coming from GDB.
GDBServerFoundation::BreakInSocket::BreakInSocket |
( |
BazisLib::Network::TCPSocketEx * |
pSock | ) |
|
|
inline |
GDBServerFoundation::BreakInSocket::~BreakInSocket |
( |
| ) |
|
|
inline |
size_t GDBServerFoundation::BreakInSocket::Send |
( |
const void * |
pBuffer, |
|
|
size_t |
size |
|
) |
| |
|
inline |
void GDBServerFoundation::BreakInSocket::SetTarget |
( |
IBreakInTarget * |
pTarget | ) |
|
|
inline |
The documentation for this class was generated from the following file: