Skip to content

No exception while using PrintWriter and outputstream #93

Open
@peacand

Description

@peacand

Hi,

When I use a wrapper PrintWriter over a UnixSocketChannel OutputStream, no exception is raised when I try to println(String) on the PrintWriter object while the socket is actually remotely closed.

To reproduce the issue, you need a simple client/server with a UnixSocketChanel.
Then a PrintWriter with :

PrintWriter w = new PrintWriter(Channels.newOutputStream(channel));

If you close the socket on the server side and then try to use the PrintWriter afterwards, no exception is raised.
I've seen that (PrintWriter)w.checkError() returns actually true, which shows the error. But I think a proper "SocketClosed" exception or something like that would be nice.

Thank you for your help

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