Concurrent programming -- collaborative process, Greenlet module, Gevent module, synchronous and asynchronous of Gevent, Gevent application
An introduction
The topic of this section is to realize concurrency based on single thread, that is, to realize concurrency with only one main thread (obviously, there is only one available cpu). Therefore, we need to review the essence of concurrency first: switching + saving state. The cpu is running a task and will switch to execute oth ...
Posted by Ben5on on Mon, 07 Mar 2022 05:38:51 +0100
Netty Source Analysis 3: Create a simple Netty service and test it
Create and start a Netty server
How do I create and start a Netty server? Start a netty server and listen on port 8888 with the following code.
public class MyNettyServer {
private static Logger logger = LogManager.getLogger(MyNettyServer.class);
public static void main(String[] args) throws InterruptedException {
NioEven ...
Posted by 1josh13 on Sat, 05 Mar 2022 06:14:11 +0100
Day 28 of learning big data - UDP, TCP transmission, classloader, reflection and dynamic proxy
UDP transport
1: Establish udp socket service 2: Receive data through receive method 3: Store the received data in the packet object 4: Analyze the received data through the function of packet object 5: Resources can be closed
client
/*
Add feedback according to our normal thinking, but there is no response. Why
The reas ...
Posted by zarp on Sat, 26 Feb 2022 15:23:27 +0100
TCP network programming
1, Basic concepts of network programming
1. What is computer network Computers distributed in different regions are interconnected by communication lines through network devices such as hardware Computer network, can be very convenient for information transmission, resource sharing!
2. What is the IP address of the computer IP address is the ...
Posted by marian on Thu, 24 Feb 2022 15:10:23 +0100
Network operation
Network operation
Network support in Java:
InetAddress: used to represent hardware resources on the network, i.e. IP address;URL: uniform resource locator;Sockets: use TCP protocol to realize network communication;Datagram: use UDP protocol to realize network communication.
InetAddress
There is no public constructor. You can only create inst ...
Posted by richrock on Thu, 24 Feb 2022 12:22:34 +0100
Computer network communication
OSI network seven layer model: (Open System Interconnection), translated as "Open System Interconnection" Physical layer, data link layer, network layer, transport layer, session layer, presentation layer and application layer
TCP/IP simplifies OSI, merges some layers, and finally retains only four layers, including interface layer, ...
Posted by Pedro Sim on Thu, 24 Feb 2022 06:57:27 +0100
Basic flow of C/S program based on TCP protocol
Server communication process
Server:
1,adopt socket()Function to create a to receive a connection request socket
2,To construct the host connection address sockaddr_in structural morphology,include sin_family,sin_port,sin_addr Three members
3,binding sockaddr_in Structure and socket
4,adopt listen()Function will stocket Set to listenin ...
Posted by mdemetri2 on Wed, 23 Feb 2022 02:59:37 +0100
Settings related to TCP keepalive in Postgresql
Database connection description
When it comes to TCP keepalive related settings, you can't avoid the topic of database connection. At present, in most use environments, database connections are long connections, that is, connections can be reused.
Because the database connection is different from HTTP connection, HTTP is stateless, and the co ...
Posted by chemoautotroph on Tue, 22 Feb 2022 10:54:46 +0100
Summary of common network commands
catalogue
Network connectivity detectionCheck socket connectionNetwork usage detectionNetwork packet capturetransfer filesConnection idle timesummary
Network connectivity detection
In case of network abnormality in the application, the first thing to confirm is whether the network connectivity is normal. The following group of commands can ...
Posted by MickeySox on Mon, 21 Feb 2022 01:45:05 +0100
UDP, TCP, Lambda expression, interface composition update, method reference
UDP communication principle: UDP protocol is an unreliable network protocol. It has a Socket object at both ends of the communication, but these two sockets are only the objects to send and receive data
Both sides of communication based on UDP protocol have no so-called concept of client and server
The datagram Socket class provided by Java i ...
Posted by mooler on Sun, 20 Feb 2022 10:31:58 +0100