Skip to content

Newline driven approach #8

Description

@stefanlechner

After debugging a while, I figured out, that the communication is hard newline driven.

            synchronized(inputStream) {
                try {
                    val receivedString = **reader.readLine()**
                    if (!TextUtils.isEmpty(receivedString)) {
                        emitter.onNext(receivedString)
                    }
                } catch (e: Exception) {
                    if (!emitter.isCancelled && !closed.get()) {
                        emitter.onError(e)
                    }
                }

My communication requries a # or \r\n as delimiter.
There are several ways to solve this, the easiest and most flexibility providing solution, seems to me, changing from reader.readLine() to a scanner with a regex.
Are you interested in a modification like this ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions