Skip to content

Conversation

@Tomsons
Copy link

@Tomsons Tomsons commented Aug 8, 2025

The current implementation sometimes splits the bestmove response on 2 lines, this is related to the fact that the output can be chunked arbitrarily, especially when using NSFileHandle in async mode.

This fix ensures that every line entirely parsed once ready

@Tomsons Tomsons changed the title bestmove output gets sometimes split on 2 lines fix: bestmove output gets sometimes split on 2 lines Aug 8, 2025
@pdil pdil added the bug A bug or issue that should be resolved label Aug 10, 2025
@pdil pdil self-requested a review August 10, 2025 18:10
@Tomsons
Copy link
Author

Tomsons commented Oct 3, 2025

@pdil ?

/// Engines work asynchronously so use this block to subscribe to
/// any commands received from the engine.
@property (nullable) void (^ responseHandler)(NSString * _Nonnull response);
@property (nonatomic, strong) NSMutableString *outputBuffer;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this could be an ivar like the pipes/file handles/lock/engine or a property inside a class extension inside EngineMessenger.mm, no reason to expose it outside of EngineMessenger class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug A bug or issue that should be resolved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants