Basic knowledge of java (returning to nature) -- chapter2 (IO and NIO)

Traditional BIO mode For the traditional IO model, one Server interfaces with N clients. After the clients are connected, an execution thread is allocated to each client. characteristic: ① After each client connection arrives, a thread will be allocated to the client. It is used for reading and writing data, encoding and decoding and business c ...

Posted by mabus on Sun, 16 Jan 2022 07:00:57 +0100

Java basic syntax_ 24_ Network programming 02

1.NIO 1.1 NIO channel client [application] Client implementation steps Open channelSpecify the IP and port numberWrite dataRelease resources Sample code public class NIOClient { public static void main(String[] args) throws IOException { //1. Open the channel SocketChannel socketChannel = SocketChannel.open(); ...

Posted by uNF on Fri, 14 Jan 2022 22:20:30 +0100

Java interview questions - NIO related interview questions

1. Differences among NiO, BIO and AIO BIO: the traditional network communication model is BIO, synchronous blocking IO In fact, the server creates a ServerSocket, and then the client uses a Socket to connect to the ServerSocket of the server. When the ServerSocket receives a connection request, it creates a Socket and a thread to communicate ...

Posted by rocketsprocket on Fri, 14 Jan 2022 08:59:49 +0100

Netty entry and advanced 4 ❤❤❤ Network programming

4. Netty entry and advanced 4 ❤❤❤ Network programming 4.1 non blocking vs blocking block In blocking mode, the related methods will cause the thread to pause ServerSocketChannel.accept suspends the thread when no connection is establishedSocketChannel.read pauses the thread when there is no data to readThe performance of blocking is actua ...

Posted by rbarnett on Wed, 05 Jan 2022 10:40:55 +0100

Java_ Detailed explanation of IO flow

Java_IO stream The important thing in learning IO flow is to know when to use what flow 1, Disk operation 1.1 concept What is a file Files are not unfamiliar to us. Files are places to save data, such as word documents, txt files, excel files... All of which are files. It can save a picture, video, sound File stream Files are operate ...

Posted by ramas on Thu, 09 Dec 2021 15:52:18 +0100

Summary of the top ten classic sorting algorithms (including JAVA code implementation)

In recent days, I have studied sorting algorithm and read many blogs. I found that some articles on the Internet do not explain sorting algorithm thoroughly, and many codes are wrong. For example, some articles directly use the Collection.sort() function to sort each bucket in the "bucket sorting" algorithm, which can achieve results, ...

Posted by clem_c_rock on Tue, 30 Nov 2021 22:14:54 +0100