Event Loop in Node.js
What is Event Cycle
As we all know, JavaScript is single-threaded, and Nodejs can implement non-blocking I/O operations, because Event Loop exists.
Event Loop has the following stages, a rectangle represents a stage, as follows:
┌───────────────────────┐
┌─>│ timers │
│ └──────────┬────────────┘
│ ┌──────────┴──────────── ...
Posted by Matty999555 on Fri, 19 Jul 2019 08:22:48 +0200
TeamTalk Server-side Analysis of Server-side and Client-side Processes
Original: www.bluefoxah.org/teamtalk/server_flow.html
Preface
In the previous article, we simply analyzed the configuration of each server. In this article, we simply analyzed the whole operation process of TeamTalk server.
Server-side process
There is no strict sequential process for the start-up of the server, because each end ...
Posted by puja on Thu, 11 Jul 2019 00:32:13 +0200
Interprocess Communication--IPC
Preface:
Inter-process Communication (IPC) refers to the communication between processes. Generally speaking, an app has only one process, but may have multiple threads, so we use multithreaded communication, such as handler,AsyncTask.
But in some special cases, we need multiple processes in our app, or we need to communicate across processes w ...
Posted by kaimason1 on Wed, 10 Jul 2019 19:56:18 +0200
Interprocess Communication -- Pipeline, Message Queue
We learn advanced process communication, which means that users can efficiently transmit large amounts of data using a set of communication commands provided by the operating system.
Several main means of interprocess communication: pipeline, message queue, shared memory, socket
The Conduit
Pipeline, a shared file used to connect a read p ...
Posted by MarkR on Tue, 09 Jul 2019 01:58:52 +0200
socket.io II: Basic Applications
socket.io provides event-based real-time two-way communication
Connection between server and client
socket.io also provides API s for both the server and the client
Server socket.io must bind an instance of http.Server
Binding http.Server
Implicit binding
Implicit binding is done by calling listen or attach functions when an incoming port is in ...
Posted by JeanieTallis on Sun, 07 Jul 2019 21:01:02 +0200
Android Bluetooth Chat
Bluetooth is one of the most popular methods of data transmission for smart devices. It connects with smart devices through mobile app s to obtain measurement data on devices. We can see it everywhere in our life, such as Bluetooth smart bracelet, Bluetooth electronic scales, Bluetooth ECG measurement equipment and so on.
In this article, ...
Posted by Control Pad on Fri, 05 Jul 2019 23:36:38 +0200
Bluetooth module of android uses hexadecimal data to send
A Bluetooth module looks small, but it's still a bit complicated. I found a sample code from the Internet, http://blog.csdn.net/vnanyesheshou/article/details/51554852, but it can't be used directly. It needs to be read, understood and modified by myself before it can be used.
First paste a homemade uml map:
It is not difficult to see from t ...
Posted by jwmessiah on Mon, 01 Jul 2019 21:48:19 +0200
List of Java.NIO Stream Programming
Simple differences between Java standard IO and Java NIO indicate:
Java Standard IO
Java NIO
API calls
simple
complex
Low-level implementation
Stream-oriented, one-way
channel Oriented, Release CPU, Memory Pressure
Results
Synchronized blocking
Synchronized non-blocking
Data Peep
Bloc ...
Posted by proxydude on Mon, 01 Jul 2019 00:27:07 +0200
socket programming (online automatic Chat tool) --Python3
Catalog
@
1. The server supports only one client connection
Server-side program (server.py):
import socket
# Create a server-side socket object
server = socket.socket()
# Bind IP (ipocnfig command looks at IP address) and port (custom network port can be used without conflicting with an existing system port)
server.bin ...
Posted by leena on Sun, 30 Jun 2019 21:08:50 +0200
Learn docker from scratch to deploy a slightly loaded application
We talked about deploying a simple Python program before.
In this section, we will extend the Python program, connect redis database, and do some operations on redis.
New App.py, as follows:
from flask import Flask
from redis import Redis
import os
import socket
app = Flask(__name__)
redis = Redis(host=os.environ.get('REDIS_HOST', '12 ...
Posted by iShaun on Sat, 29 Jun 2019 20:28:14 +0200