mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:07:34 +00:00
LibChess: Allow UCIEndpoint to handle unexpected disconnections
This commit is contained in:
parent
bf320e4826
commit
680d4e34d5
2 changed files with 18 additions and 0 deletions
|
@ -31,6 +31,7 @@ public:
|
|||
virtual void handle_bestmove(BestMoveCommand const&) { }
|
||||
virtual void handle_info(InfoCommand const&) { }
|
||||
virtual void handle_quit() { }
|
||||
virtual void handle_unexpected_eof() { }
|
||||
|
||||
void send_command(Command const&);
|
||||
|
||||
|
@ -49,8 +50,12 @@ public:
|
|||
protected:
|
||||
Endpoint() = default;
|
||||
Endpoint(NonnullRefPtr<Core::IODevice> in, NonnullRefPtr<Core::IODevice> out);
|
||||
virtual void custom_event(Core::CustomEvent&) override;
|
||||
|
||||
private:
|
||||
enum EndpointEventType {
|
||||
UnexpectedEof
|
||||
};
|
||||
void set_in_notifier();
|
||||
NonnullOwnPtr<Command> read_command();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue