Benefits of Netty over basic ServerSocket server?

The main advantage of Netty over simply reading from and writing to sockets using streams is that Netty supports non-blocking, asynchronous I/O (using Java’s NIO API); when you use streams to read and write from sockets (and you start a new thread for each connected accepted from a ServerSocket) you are using blocking, synchronous I/O. … Read more

Difference between TCP Listener and Socket

TcpListener is a convenient wrapper for TCP communications. This allows you to use TcpClient for accepted connections–although you can accept sockets instead of clients to use Socket instead of TcpClient. You can do the same thing with Socket; but you have to deal with some of the TCP-specifics (like SocketType.Stream, ProtocolType.Tcp). TCP is a stream-based … Read more

What is the difference between Socket and ServerSocket?

(I post this answer because I always feel it’s important to make the logic right.) I suggest you take a look at the following sample. http://docs.oracle.com/javase/tutorial/networking/sockets/clientServer.html Admittedly, when carrying out TCP/IP communication, all the necessary information can be provided by the Socket class alone for the sole purpose of communication. No matter it is on … Read more