Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

The blocking read on istream.read() can cause delays in reaching the onClose callback when a close command is issued externally #1478

Copy link
Copy link
@adamscm

Description

@adamscm
Issue body actions

Describe the bug

The blocking read on istream.read() can cause delays in reaching the onClose callback when a close command is issued externally.

try {
while (!isClosing() && !isClosed() && (readBytes = istream.read(rawbuffer)) != -1) {
engine.decode(ByteBuffer.wrap(rawbuffer, 0, readBytes));
}
engine.eot();
} catch (IOException e) {
handleIOException(e);
} catch (RuntimeException e) {
// this catch case covers internal errors only and indicates a bug in this websocket implementation
onError(e);
engine.closeConnection(CloseFrame.ABNORMAL_CLOSE, e.getMessage());
}

To Reproduce
Steps to reproduce the behavior:

1.connect
2.send
3.close (server delay send any data)

Example application to reproduce the issue

Expected behavior

onclose no delay

Debug log

Environment(please complete the following information):

Additional context

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.