Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6958601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:09:41+00:00 2026-05-27T15:09:41+00:00

Netty is throwing the following exception when i send a message asynchronously from my

  • 0

Netty is throwing the following exception when i send a message asynchronously from my client and then close the channel.

java.nio.channels.ClosedChannelException
at sun.nio.ch.SocketChannelImpl.ensureWriteOpen(SocketChannelImpl.java:133)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:324)
at org.jboss.netty.channel.socket.nio.SocketSendBufferPool$PooledSendBuffer.transferTo(SocketSendBufferPool.java:239)
at org.jboss.netty.channel.socket.nio.NioWorker.write0(NioWorker.java:469)
at org.jboss.netty.channel.socket.nio.NioWorker.writeFromTaskLoop(NioWorker.java:392)
at org.jboss.netty.channel.socket.nio.NioSocketChannel$WriteTask.run(NioSocketChannel.java:276)
at org.jboss.netty.channel.socket.nio.NioWorker.processWriteTaskQueue(NioWorker.java:268)
at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:199)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)

My send code is as follows:

Channels.write(clientChannel, messageObject);

My close code is as follows:

    ChannelGroupFuture future = ALL_CHANNELS.close();
    future.awaitUninterruptibly();
    if (null != clientBootstrap) {
        clientBootstrap.releaseExternalResources();
    }

Is there anything I need to do to flush the Channel before closing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:09:42+00:00Added an answer on May 27, 2026 at 3:09 pm

    Sorry I don’t understand your problem. You now close the channel after the write is complete (like Veebs suggested) and now you complain it fails for new writes as the channel is closed ? If you need more then write operation you need to add the ChannelFutureListener.CLOSE to the last future that was returned.

    Hope it helps..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The Netty library (written in Java) defines the following write method in the channel
I have server application based on Netty. It decode message (from json) and send
The following is isEmpty() method from ConcurrentWeakKeyHashMap.java, https://github.com/netty/netty/blob/master/src/main/java/org/jboss/netty/util/internal/ConcurrentWeakKeyHashMap.java Why does it need mcsum, and
I am considering moving my Java NIO implementation over to JBoss Netty as it
I just downloaded Netty for a personal client-server-project from here: http://netty.io/downloads/netty-3.3.0.Final-dist.tar.bz2 On the download
I'm using Netty Http client to send requests to a http server. I am
Is it possible to write to Netty channel without creating unnecessary ChannelFuture? (Without generating
I am designing a binary protocol for client/server communication using Netty and the number
I need to open a TCP/IP client connection with my Netty Server business handler.
I have a netty channel and I would like to set a timeout on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.