Noejs Learning Notes 3

Building TCP Server Node implements HTTP server in the form of http.Server pseudoclass, which inherits from TCP server pseudoclass in. net Server. TCP server declaration cycle var server = require('net').createServer(); var port = 4001; server.on('listening',function(){ console.log('server is listening on port',port); }); server.on( ...

Posted by ealderton on Mon, 01 Apr 2019 06:42:29 -0700

JavaScript example of WebSocket

A simple Echo example of WebSocket: The sample code comes from: http://www.websocket.org/echo.html Using a text editor, copy and save the following code in a websocket.html file, and as soon as you open it in the browser, the page will automatically connect using websocket, send a message, display the received server response, and then clo ...

Posted by leapingfrog on Sun, 31 Mar 2019 20:48:29 -0700

Android implements two-process daemon

How to ensure that Service is not Kill For knowledge about Service, please refer to Comprehensive Analysis of Android Service This article is written in great detail. (1) onStartCommand method, returning START_STICKY @Override public int onStartCommand(Intent intent, int flags, int startId) { flags = START_STICKY; return super. ...

Posted by dzoddi on Thu, 28 Mar 2019 18:00:28 -0700

Analysis of Single Core CPU Occupied by Linux Processes

pidstat 1 information You can see if the process with pid 12186 is occupying CPU 0 and using CPU 0 at 100%, or if system consumes CPU 0 at 100%. Mpstat-P ALL 1 Information     Use the ps command to view the cpu consumption of threads in the process ps -mp 12186 -o THREAD,tid,time USER %CPU PRI SCNT WCHAN USER SYSTEM TID TIME actiont+ 176 ...

Posted by gareh on Thu, 28 Mar 2019 01:33:30 -0700

Summary of Basic Learning of java-Network Communication

Connection-oriented TCP "Connection-oriented" means that a connection must be established with the other party before formal communication. For example, when you call someone, you have to wait until the line is connected and the other person picks up the microphone to talk to each other. TCP (Transmission Control Protocol) is a c ...

Posted by goobers on Wed, 27 Mar 2019 18:54:28 -0700

One linux command per day: ss command

ss is the abbreviation of Socket Statistics. As the name implies, the ss command can be used to obtain socket statistics, which can display content similar to netstat. But the advantage of ss is that it can display more detailed information about TCP and connection status, and it is faster and more efficient than netstat. When the number of s ...

Posted by phpfreak101 on Wed, 27 Mar 2019 11:36:29 -0700

android bluetooth: Bluetooth's Opening, Searching, Matching and Connecting

Android blt only supports API 18 Android 4.3 or more, and some functions even require API 19 Android 4.4. So before we do blt projects, we must be clear about the range of versions available. I'm going to talk about the operation of opening the BLT gate. These operations are how to open blt, how to search for other devices, how to p ...

Posted by poe on Mon, 25 Mar 2019 07:54:30 -0700

JAVASE Foundation - day26 (Network Programming)

The teaching catalogue of day26: 26.01 Network Programming (Overview of Network Programming) (Understanding) A: Computer Network It refers to a computer system that connects multiple computers with independent functions in different geographical locations and their external devices through communication lines, realizes resource sharing an ...

Posted by ababmxking on Sun, 24 Mar 2019 03:51:30 -0700

Android system startup process (1) parsing init process

Related articles Android System Architecture and System Source Directory Preface As the first series in the "Android Framework Layer" series, we first need to understand the Android system startup process, which involves a lot of important knowledge points. In this series, we will explain them one by one. In this article, we will ...

Posted by Buchead on Sun, 24 Mar 2019 03:12:27 -0700

Okio usage analysis

Recently, in researching the concrete implementation of retrofit, retrofit uses okhttp,okhttp uses Okio,so I want to start with the bottom Okio. And I haven't taken a serious look at the IO block of java, so I take this opportunity to learn about io. This article is about Okio. Next, I should write about okhttp and retrofit. There are a lot o ...

Posted by werty37 on Sat, 23 Mar 2019 03:15:55 -0700