|
wxMaxima
|
Checks the first line a would-be interrupt channel sends. More...
#include <InterruptChannelHandshake.h>
Public Types | |
| enum class | State { pending , accepted , rejected } |
Public Member Functions | |
| InterruptChannelHandshake (std::string token) | |
| State | Feed (const char *data, std::size_t length) |
Processes the next length bytes the connection sent. | |
| State | GetState () const |
Checks the first line a would-be interrupt channel sends.
Maxima's Lisp opens a second connection to wxMaxima's server that wxMaxima writes "interrupt" to (see MaximaInterruptChannel and wx-open-interrupt-channel in wxMathML.lisp). wxMaxima's server listens on a local port anybody on this machine can connect to, so a connection only becomes the interrupt channel after its first line is the secret wxMaxima handed to Maxima in MAXIMA_AUTH_CODE.
Kept free of sockets and of wxWidgets so it can be tested on its own: bytes go in through Feed() in whatever pieces the network delivers them.
| InterruptChannelHandshake::State InterruptChannelHandshake::Feed | ( | const char * | data, |
| std::size_t | length | ||
| ) |
Processes the next length bytes the connection sent.
Returns the state afterwards. Once the state is accepted or rejected it no longer changes: whatever a channel sends after its token is ignored.