Skip to content

PseudoTcpSocket input stream doesn't support readNBytes #244

@indiscrete-void

Description

@indiscrete-void

Calling readNBytes on InputStream of pseudo tcp socket instance, causes it to hang in loop forever.
I think this behavior is caused by PseudoTcpInputStream#read(byte[], int, int) implementation which doesn't know how to handle length of zero, i.e. when length of zero is provided it loops forever because in these lines:

read = pseudoTcp.recv(buffer, offset, length);

read = pseudoTcp.recv(buffer, offset, length);
if (logger.isLoggable(Level.FINER))
{
    logger.log(Level.FINER,
               "Read Recv read count: " + read);
}
if (read > 0)
{
    return read;
}

read is never more than zero, if length=0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions