Knowledge is fragmentary, only for exams
Chapter 1 Getting Started
Chapter 2 Socket
I feel that socket is a link in the CS architecture.
Delayed waiting
related methods are
half closed.
It is necessary to carry a simple client and server side.
It is necessary to back a stream operation
Chapter 3 SERVER SOCKET
The construction method
port is set to 0 to be an anonymous port. It
feels that as long as the backlog parameter value is illegal or not, it is the operating system decision.
This construction method is suitable for
the usage of multiple ip accept methods.
Multithreading skips, I don’t want to read @-@
56两问在There are advantages and disadvantages of threads
Chapter 4 Non-blocking Communication
The concept of
a blocking operating system Common causes of blocking:
- sleep
- wait
- accept
- Input and output stream
- connect
- Sync code
- IO operation/remote communication
- Shutdown delay time and other
blocking limitations. The
limitation is that the virtual machine opens up memory space
frequently and frequently schedules cpu
Non-blocking principle
This concept is really
daunting. Let's look at non-blocking code later. . .
Later he comes
Postion is similar to a pointer. Capacity is the total buffer. Limit means that the following will not belong to the buffer.
Position and limit change after the read operation
. When writing, put (buffer.getbyte()) is required for
reading.
So the above code is used Allocate creates a buffer in the jvm,
allocatedirect, to open up important and long-term use. Although it is efficient, it occupies memory space and
acts as a link, and does not directly return data
. This is how the current channel is, before the cpu directly controlled io
Either DMA management io
can operate asynchronously under channel
Chapter 5: Creating non-blocking HTTP
HTTP requests are divided into request methods, request headers, request body,
and the difference between get and post. One gets one submission form, one has more data, and one has less data. The
HTTP response is also divided into three parts, http version, status, and response header , The response body The
specific code is ignored
Chapter 8 UDP-based datagrams and sockets
In the two udp interactions I wrote earlier, I saw that datagramsocket is only responsible for receiving and sending.
The real transmission is to
send through datagrampacket, it can only be a sequence of bytes, and then change it back to the receiver
. I didn’t see the non-blocking in the back
Chapter 9 Serialization and Deserialization
Self-built Customer class inherits the Serializable interface to complete serialization and deserialization.
Static variables will not be serialized.
Deserialization will not call the construction method. It will only fetch data directly from memory. The
externalizable interface will be used during deserialization. Parameter construction method
JDBC
Chapter 15 jsse
Remember
Jsse: java secure socket extension java secure socket extension
SSL: server socket layer
TLS: transport Layer Security