Netty practice — Netty handles sticky packet unpacking

TCP packet sticking/unpacking TCP processes data in a streaming manner. Unpacking: A complete data packet may be split into multiple packets by TCP for sending. Sticky packets: TCP may stick multiple small packets into one large data packet. Introduce dependency packages: <dependency> <groupId>io.netty</groupId> <artifactId>netty-all</artifactId> <version>4.1.29.Final</version> </dependency> Example of sticky package unpacking: Server EchoServer: /** * […]

[Linux] File permissions, directory permissions, masks, sticky bits and related instructions

Article directory Linux permissions Two kinds of users Linux permission management Three questions: What are permissions? What are the three roles: So why do belonging groups exist? File types and access rights (thing properties) a) File type b)Basic permissions How to express file permission values How to set file access permissions a)chmod b)chown c)chgrp permission […]

Sticky bag and half bag problems and solutions

The sticky packet problem means that during data transmission, part of the data of another message is read in one message. This phenomenon is called sticky packet. The half-packet problem means that when data is transmitted, the receiving end only receives part of the data instead of the complete data, which is called a half-packet. […]

Socket abstraction layer and sticky packets

Table of Contents 1. Socket abstraction layer 2. Socket programming based on TCP protocol 2.1 Server socket function 2.2 Client socket functions 2.3 Public-purpose socket functions 2.4 Lock-oriented socket approach 2.5 File-oriented socket functions Socket programming based on TCP protocol (simple) Server client 3. Socket programming + communication + communication cycle Server client 4. Socket […]

golang solves TCP sticky problem

What is the TCP sticky problem and why TCP sticky packets occur will not be discussed in this article. This article uses golang’s bufio.Scanner to implement custom protocol unpacking. Protocol packet definition This article simulates a log server that receives data packets from the client and displays them. type Package struct { Version [2]byte //Protocol […]

Implementing Sticky Session in Spring Boot API Gateway

Article directory summary question Implement Sticky Session in API Gateway Support both Sticky Session and RoundRobinLoadBalancer in the same API Gateway refer to Summary In the cloud environment of Kubernetes microservices, how to implement Sticky Session in Spring Boot API Gateway? When a service request is processed by a certain server, all subsequent requests are […]

8-2udp and tcp network programming and sticky packets and methods to solve sticky packets

1 tcp network programming 1 server side 2 3 import socket 4 sk=socket.socket() #instantiate an object 5 sk.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)#Ports can be reused 6 sk.bind((‘127.0.0.1’,9100)) 7 sk.listen()#Listen 8 while True: 9 conn,addr=sk.accept() #Blocking, three-way handshake completed 10 while True: 11 inp=input(‘Please enter the message you want to send: ‘) 12 conn.send(inp.encode(‘utf-8’)) 13 if inp == ‘q’: break […]

Use sticky.js to fix the head navigation bar

On the page, if the page length is too large, the head navigation bar will slide away when the page is slid. My header navigation bar code is: 1 <div class=”headbar”> 2 <center class=”headbarTitle”>Address Book</center> 3 </div> Method to fix the head navigation bar: introduce sticky.js, plus 1 //Head navigation fixed 2 $(“.headbar”).sticky( 3 { […]

Go language network programming (socket programming) TCP sticky packet

1. TCP sticky packet The server code is as follows: // socket_stick/server/main.go func process(conn net.Conn) {<!– –> defer conn.Close() reader := bufio.NewReader(conn) var buf[1024]byte for {<!– –> n, err := reader.Read(buf[:]) if err == io.EOF {<!– –> break } if err != nil {<!– –> fmt.Println(“read from client failed, err:”, err) break } recvStr := […]

Basic usage of LiveData and methods to remove sticky data

Directory 1. Basic use of LiveData 1. Usage method one 2. Usage method two 3. Usage method three 2. LiveData’s method of removing sticky data 1. Remove sticky Java version 2. Remove the sticky Kotlin version 1. Basic use of LiveData When LiveData adds an observer, it will associate a LifecycleOwner, and then package the […]