Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling write on a ServerSocketChannel fatal errors with bogus message #222

Closed
weissi opened this issue Mar 22, 2018 · 1 comment
Closed
Assignees
Labels
good first issue Good for newcomers kind/bug Feature doesn't work as expected.
Milestone

Comments

@weissi
Copy link
Member

weissi commented Mar 22, 2018

Expected behavior

Calling write on a ServerSocketChannel should fail the promise with ChannelError.unsupportedOperation.

Actual behavior

It fatal errors with a bogus message that suggests the subclass (which is ServerSocketChannel must implement a method)

Steps to reproduce

  1. create a server bootstrap
  2. bind
  3. .wait/.then
  4. write to the Channel returned (which is a ServerSocketChannel)

If possible, minimal yet complete reproducer code (or URL to code)

    let bootstrap = ServerBootstrap(group: group)
       .childChannelOption(ChannelOptions.socket(SocketOptionLevel(SOL_SOCKET), SO_REUSEADDR), value: 1)
    defer {
        try! group.syncShutdownGracefully()
    }
    try! bootstrap.bind(host: "127.0.0.1", port: 12345).wait().write(NIOAny("foo bar")).wait()

then connect to port 12345

SwiftNIO version/commit hash

any

Swift & OS version (output of swift --version && uname -a)

any

@normanmaurer
Copy link
Member

This was fixed

@normanmaurer normanmaurer self-assigned this Mar 23, 2018
@normanmaurer normanmaurer added this to the 1.3.0 milestone Mar 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers kind/bug Feature doesn't work as expected.
Projects
None yet
Development

No branches or pull requests

2 participants