自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

独行者103的专栏

专注Android和安全

  • 博客(564)
  • 收藏
  • 关注

原创 旧版本Compose项目如何迁移到Koltin 2.0版本

除了删除composeOptions外,链接给出了使用libs.versions.toml的方法。并不是说官方给的教程不好,而是有很多旧版本的gradle文件没有做这样的配置。1.非常老的,以buildscript为顶级节点的,修改如下。所以就为老版本提供相关迁移方法,并做具体记录。对应模块的build.gradle增加。2.较新的,以plugin为根节点的。

2024-07-01 10:48:37 301

原创 TCP/IP Illustrated Episode 31

NoteThere has been some difficulty in Windows environments regarding the use of the broadcast flag. Windows XP and Windows 7 DHCP clients do not set the flag, but Windows Vista clients do. Some DHCP...

2024-07-01 10:47:35 545 1

原创 Unix Network Programming Episode 97

Unix Domain Datagram Client/Server#include "unp.h"int main(int argc, char **argv){ int sockfd; struct sockaddr_un servaddr; sockfd=Socket(AF_LOCAL, SOCK_STREAM,0); bzero(&ser...

2024-07-01 10:47:09 734 1

原创 Unix Network Programming Episode 96

‘socketpair’ FunctionThe socketpair function creates two sockets that are then connected together. This function applies only to Unix domain sockets.#include <sys/socket.h>int socketpair(int ...

2024-07-01 10:46:52 585 1

原创 TCP/IP Illustrated Episode 30

Attacks Involving IPThere have been a number of attacks on the IP protocol over the years, based primarily on the operation of options, or by exploiting bugs in specialized code (such as fragment rea...

2024-06-03 14:00:46 900 1

原创 TCP/IP Illustrated Episode 29

Host ModelsAlthough it may appear to be a straightforward decision to determine whether a received unicast datagram matches one of a host’s IP addresses and should be processed, this decision depends...

2024-06-03 14:00:24 537 1

原创 Unix Network Programming Episode 95

Unix Domain ProtocolsIntroductionThe Unix domain protocols are not an actual protocol suite, but a way of performing client/server communication on a single host using the same API that is used for ...

2024-06-03 13:59:56 490 1

原创 Unix Network Programming Episode 94

The kqueue interface includes the following two functions and macro:#include <sys/types.h>#include <sys/event.h>#include <sys/time.h>int kqueue(void);int kevent(int kq, const st...

2024-06-03 13:59:45 198 1

原创 Leetcode 547 Number of Provinces

There are n cities. Some of them are connected, while some are not. If city a is connected directly with city b, and city b is connected directly with city c, then city a is connected indirectly with city c.A province is a group of directly or indirectly

2024-05-06 13:18:41 321 1

原创 TCP/IP Illustrated Episode 28

DiscussionIn the examples we have just seen there are a few key points that should be kept in mind regarding the operation of IP unicast forwarding:1.Most of the hosts and routers in this example us...

2024-05-06 13:17:57 667 1

原创 Unix Network Programming Episode 93

The problem here is the buffering performed automatically by the standard I/O library on the server. There are three types of buffering performed by the standard I/O library:1.Fully buffered means th...

2024-05-06 13:16:59 659 1

原创 Unix Network Programming Episode 92

The difference between CMSG_LEN and CMSG_SPACE is that the former does not account for any padding following the data portion of the ancillary data object and is therefore the value to store in cmsg_l...

2024-05-06 13:16:44 772 1

原创 LeetCode 2041 Accepted Candidates From the Interviews

答案select candidate_idfrom Candidates cjoin Rounds r on c.interview_id = r.interview_idgroup by candidate_id, years_of_exphaving years_of_exp >= 2 and sum(score) >= 16

2024-04-07 11:02:08 111

原创 TCP/IP Illustrated Episode 27

Fragment HeaderThe Fragment header is used by an IPv6 source when sending a datagram larger than the path MTU of the datagram’s intended destination. Path MTU and how it is determined are discussed i...

2024-04-07 11:01:46 494 1

原创 Unix Network Programming Episode 91

Both functions package most arguments into a msghdr structure.struct msghdr { void *msg_name; /* protocol address */ socklen_t msg_namelen; /* size of protocol address */ struct iovec *msg_iov; /*...

2024-04-07 11:01:18 887 1

原创 Unix Network Programming Episode 90

#include "unp.h"int readable_timeo(int fd, int second){ fd_set rset; struct timeval tv; FD_ZERO(&rset); FD_SET(fd, &rset); tv.tv_sec=second; t

2024-04-07 11:01:01 267 1

原创 Antdv子列表获取父列表的index

主要是slot-scope那里要加上index,这样就字列表就能获得父列表的index。

2024-03-04 17:51:48 210

原创 TCP/IP Illustrated Episode 26

Pad1 and PadNIPv6 options are aligned to 8-byte offsets, so options that are naturally smaller are padded with 0 bytes to round out their lengths to the nearest 8 bytes. Two padding options are avail...

2024-03-04 17:51:11 781 1

原创 Unix Network Programming Episode 89

Advanced I/O FunctionsIntroductionThis chapter covers a variety of functions and techniques that we lump into the category of “advanced I/O.” First is setting a timeout on an I/O operation, which ca...

2024-03-04 17:50:41 275 1

原创 Unix Network Programming Episode 88

‘inetd’ DaemonOn a typical Unix system, there could be many servers in existence, just waiting for a client request to arrive. Examples are FTP, Telnet, Rlogin, TFTP, and so on. With systems before 4...

2024-03-04 17:50:24 1279 1

原创 TCP/IP Illustrated Episode 25

Mathematics of the Internet ChecksumFor the mathematically inclined, the set of 16-bit hexadecimal values V = {0001, . . . , FFFF} and the one’s complement sum operation + together form an Abelian gr...

2024-02-02 09:14:29 713 1

原创 TCP/IP Illustrated Episode 24

Using ARP to Set an Embedded Device’s IPv4 AddressAs more embedded devices are made compatible with Ethernet and the TCP/IP protocols, it is increasingly common to find network-attached devices that ...

2024-02-02 09:13:30 554 1

原创 Unix Network Programming Episode 87

‘daemon_init’ FunctionFigure 13.4 shows a function named daemon_init that we can call (normally from a server) to daemonize the process. This function should be suitable for use on all variants of Un...

2024-02-02 09:12:57 181 1

原创 Unix Network Programming Episode 86

Source Code PortabilityMost existing network applications are written assuming IPv4. sockaddr_in structures are allocated and filled in and the calls to socket specify AF_INET as the first argument. ...

2024-02-02 09:12:33 764 1

原创 Swift 5将AnyObject转成String

let valueData=try! JSONSerialization.data(withJSONObject: value)let valueString=String(data: valueData, encoding: .utf8)

2024-01-12 11:50:01 627

原创 TCP/IP Illustrated Episode 23

ARP CacheEssential to the efficient operation of ARP is the maintenance of an ARP cache (or table) on each host and router. This cache maintains the recent mappings from network-layer addresses to ha...

2024-01-12 11:49:39 953 1

原创 Unix Network Programming Episode 85

‘gethostbyname_r’ and ‘gethostbyaddr_r’ FunctionsThere are two ways to make a nonre-entrant function such as gethostbyname re-entrant.1.Instead of filling in and returning a static structure, the ca...

2024-01-12 11:49:12 956 1

原创 Unix Network Programming Episode 84

#include "unp.h"#include <time.h>int main(int argc, char **argv){ int sockfd; ssize_t n; char buff[MAXLINE]; time_t ticks; socklen_t len; struct sockaddr_storage clie...

2024-01-12 11:48:56 974 1

原创 Android JS iOS节流防抖函数备份

开发过程中遇到节流防抖问题,这里做个备份,方便以后查阅。Android:RxView.clicks(bt)// 两秒之内点击多次只响应一次点击事件 .throttleFirst(2, TimeUnit.SECONDS) .subscribe(new Observer<Object>() { @Override public void onSubscribe(Disposable d) { } @Override public voi

2023-12-05 10:30:32 538

原创 TCP/IP Illustrated Episode 22

Attacks on the Link LayerAttacking layers below TCP/IP in order to affect the operations of TCP/IP networks has been a popular approach because much of the link-layer information is not shared by the...

2023-12-05 10:30:06 853 1

原创 Unix Network Programming Episode 83

#include "unp.h"int main(int argc, char **argv){ int sockfd, n; char recvline[MAXLINE+1]; socklen_t salen; struct sockaddr *sa; if(argc!=3) err_quit("usage: daytimeudpc...

2023-12-05 10:29:39 507 1

原创 Unix Network Programming Episode 82

#include "unp.h"#include &lt;time.h&gt;int main(int argc, char **argv){ int listenfd, connfd; socklen_t len; char buff[MAXLINE]; time_t ticks; strct sockaddr_storage clientaddr...

2023-12-05 10:29:24 545 1

原创 Nodejs digital envelope routines::unsupported解决方法

如果使用17版本以上的NodeJS会导致出现digital envelope routines::unsupported的错误。如果想在IDE自动运行的时候解决这个问题,在项目文件page.json中将"scripts": { "start": "react-scripts start", "build": "react-scripts build" },改成"scripts": { "start": "SET NODE_OPTIONS=--openssl-legacy-pro

2023-11-07 09:27:05 171

原创 TCP/IP Illustrated Episode 21

LoopbackAlthough it may seem surprising, in many cases clients may wish to communicate with servers on the same computer using Internet protocols such as TCP/IP. To enable this, most implementations ...

2023-11-07 09:26:43 84 1

原创 Unix Network Programming Episode 81

#include "unp.h"int tcp_listen(const char *host, const char *serv, socklen_t *addrlenp){ int listenfd, n; const int on=1; struct addrinfo hints, res, &amp;ressave; bzero(&amp;hints...

2023-11-07 09:26:05 225 1

原创 Unix Network Programming Episode 80

‘tcp_connect’ FunctionWe will now write two functions that use getaddrinfo to handle most scenarios for the TCP clients and servers that we write. The first function, tcp_connect, performs the nor...

2023-11-07 09:25:52 249 1

原创 UICollectionView代理方法不执行

self.collectionView.reloadData() self.layoutIfNeeded()刷新数据。

2023-10-07 14:14:30 166

原创 TCP/IP Illustrated Episode 20

LCP OptionsSeveral options can be negotiated by LCP as it establishes a link for use by one or more NCPs. We shall discuss two of the more common ones. The Asynchronous Control Character Map (ACCM) o...

2023-10-07 14:13:58 81 1

原创 Unix Network Programming Episode 79

‘gai_strerror’ FunctionThe nonzero error return values from getaddrinfo have the names and meanings shown in Figure 11.7. The function gai_strerror takes one of these values as an argument and retur...

2023-10-07 14:13:24 321 1

原创 Unix Network Programming Episode 78

‘getaddrinfo’ FunctionThe gethostbyname and gethostbyaddr functions only support IPv4. The API for resolving IPv6 addresses went through several iterations, as will be described in Section 11.20(See...

2023-10-07 14:13:07 300 1

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除