Questions tagged [netty]

An open source asynchronous event-driven network application framework written in Java. It is a NIO client server framework which enables quick and easy development of network applications such as protocol servers and clients

Netty is an asynchronous event-driven network application framework for rapid development of maintainable high performance protocol servers & clients.

If you have a question about using Netty in your network application, this is the tag you should use.

Useful Links

  • Netty home page provides a user guide, JavaDoc, and various examples. Please make sure to read the user guide before posting a question. Otherwise you have a very high chance of asking a trivial question.
  • User mailing list archive contains a number of questions and answers related with Netty. If you failed to find the answer for your question, you might want to search this archive before posting the question at StackOverflow.
  • Wikipedia page

Using as a dependency in a maven project

Netty can be used in combination with the dependency system from maven.

Depending on your use case, you can either include "netty-all", or add all the modules you use separately. The following examples give an example how to use netty-all in combination with maven.

The following should be placed under the <dependencies> tag in .

Latest SNAPSHOT

<dependency>
    <groupId>io.netty</groupId>
    <artifactId>netty-all</artifactId>
    <version>5.0.0.Alpha3-SNAPSHOT</version>
</dependency>

Latest Beta

<dependency>
    <groupId>io.netty</groupId>
    <artifactId>netty-all</artifactId>
    <version>5.0.0.Alpha3</version>
</dependency>

Latest Alpha

<dependency>
    <groupId>io.netty</groupId>
    <artifactId>netty-all</artifactId>
    <version>4.1.0.Beta8</version>
</dependency>

Latest Final

<dependency>
    <groupId>io.netty</groupId>
    <artifactId>netty-all</artifactId>
    <version>4.0.35.Final</version>
</dependency>
4961 questions
197
votes
4 answers

What's the difference between Jetty and Netty?

What is the main difference between Jetty and Netty? Netty is part of Jboss, but is it the default web server container? Does Netty support Servlets 3.0?
user646584
  • 3,621
  • 5
  • 25
  • 27
153
votes
7 answers

Netty vs Apache MINA

They both provide roughly the same functionality. Which one should I choose to develop my high-performance TCP server? What are the pros & cons? Reference links: Apache MINA (source) Netty (source)
GabiMe
  • 18,105
  • 28
  • 76
  • 113
97
votes
9 answers

How to hide warning "Illegal reflective access" in java 9 without JVM argument?

I just tried to run my server with Java 9 and got next warning: WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by io.netty.util.internal.ReflectionUtil…
Dmitriy Dumanskiy
  • 11,657
  • 9
  • 37
  • 57
85
votes
8 answers

When is "java.io.IOException:Connection reset by peer" thrown?

ERROR GServerHandler - java.io.IOException: Connection reset by peer java.io.IOException: Connection reset by peer at sun.nio.ch.FileDispatcher.read0(Native Method) at sun.nio.ch.SocketDispatcher.read(Unknown Source) at…
WorM
  • 1,115
  • 1
  • 12
  • 18
49
votes
5 answers

Netty- cannot access class jdk.internal.misc.Unsafe

When I upgraded the Java from 8 to 11, I got an error from Netty about the "jdk.internal.misc.Unsafe", the details are below: I knew it is a debug level message, and I can change the level of the log to ignore it. But I'm not sure if there would be…
oarsmanli
  • 655
  • 1
  • 6
  • 6
43
votes
2 answers

How Netty uses thread pools?

Can you please explain how Netty uses thread pools to work? Do I understand correctly, that there are two kinds of thread-pools: boss and worker. Boss ones are used to do I/O and worker are used to call user callbacks (messageReceived) to process…
Vladislav Rastrusny
  • 29,378
  • 23
  • 95
  • 156
37
votes
1 answer

Use Jetty or Netty?

We're in the process of writing a high-performance server for processing messages. We've been using Jetty for several years and like it, but Netty looks like it has some cool features. In particular, it has support for asynchronous processing so a…
ccleve
  • 15,239
  • 27
  • 91
  • 157
37
votes
2 answers

Spring WebFlux differences when Netty vs. Tomcat is used under the hood

I am learninig spring webflux and I've read the following series of articles(first, second, third) In the third Article I faced the following text: Remember the same application code runs on Tomcat, Jetty or Netty. Currently, the Tomcat and Jetty…
gstackoverflow
  • 36,709
  • 117
  • 359
  • 710
37
votes
1 answer

What does ChannelOption.SO_BACKLOG do?

.option(ChannelOption.SO_BACKLOG, 100) is shown in the Netty 4 upgrade doc. Can you explain what it does? Thanks!
jestro
  • 2,524
  • 4
  • 27
  • 46
35
votes
3 answers

Benefits of Netty over basic ServerSocket server?

I need to create a relatively simple Java tcp/ip server and I'm having a little trouble determining if I should use something like Netty or just stick with simple ServerSocket and InputStream/OutputStream. We really just need to listen for a…
jluce50
  • 1,173
  • 3
  • 11
  • 14
34
votes
10 answers

How to fix the maven check style error

Currently I just tried to download and build to make the Netty source code work. But when I tried to run the command mvn eclipse:eclipse in the source folder. I got an error said [ERROR] Failed to execute goal…
Joe.wang
  • 11,537
  • 25
  • 103
  • 180
31
votes
1 answer

Create a ByteBuf in Netty 4.0

Two simple questions, which I am not able to solve by reading the documentation: I have a byte[] How can i convert it to a ByteBuf? I have a NIO ByteBuffer How can i convert it to a ByteBuf?
Dennis
  • 4,011
  • 7
  • 36
  • 50
30
votes
2 answers

Netty java getting data from ByteBuf

How to get a byte array from ByteBuf efficiently in the code below? I need to get the array and then serialize it. package testingNetty; import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import…
NiceTheo
  • 752
  • 1
  • 7
  • 16
29
votes
3 answers

How does the Netty threading model work in the case of many client connections?

I intend to use Netty in an upcoming project. This project will act as both client and server. Especially it will establish and maintain many connections to various servers while at the same time serving its own clients. Now, the documentation for…
Jiddo
  • 1,256
  • 1
  • 10
  • 15
29
votes
2 answers

Why native epoll support is introduced in Netty?

I believe Java's NIO library will use epoll on Linux machines. What are all the advantages of using Epoll instead of NIO on Linux machines.
Dhanaraj Durairaj
  • 644
  • 1
  • 6
  • 17
1
2 3
99 100