An example of UNIX domain streaming socket

Client: 1: #include <string.h> 2: #include <stdio.h> 3: #include <stdlib.h> 4: #include <strings.h> 5: #include <sys/un.h> 6: #include <sys/socket.h> 7: #include <netinet/in.h> 8: #include <arpa/inet.h> 9: #include <unistd.h> 10: 11: typedef struct sockaddr SA; 12: 13: #define N 256 14: 15: int main(int argc, char *argv[]) 16: {<!– –> 17: 18: int sockfd; 19: struct […]

Unix domain socket

Reprint: http://www.cnblogs.com/chekliang/p/3222950.html The socket API was originally designed for network communication, but later an IPC mechanism was developed based on the socket framework, which is UNIX Domain Socket. Although network sockets can also be used for inter-process communication on the same host (through loopback address 127.0.0.1), UNIX Domain Sockets are more efficient for IPC: there […]

AF_UNIX local communication programming example

AF_UNIX local communication programming example 1. Linux process communication mechanism Linux local inter-process communication generally has the following methods, and socket local domain socket is one of them. An IPC mechanism has been developed based on the socket framework, which is UNIX Domain Socket. Although network sockets can also be used for inter-process communication on […]

Interprocess Communication (IPC) Methods: UNIX Domain Sockets

UNIX domain socket (UNIX domain socket) provides us with a convenient way to establish communication channels between processes and has many useful built-in functions. Itsupports both stream-oriented (TCP) and datagram-oriented (UDP) protocols as TCP/IP internet sockets. We can also choose between blocking and non-blocking modes. First you need to create a socket and specify AF_UNIX […]

Packet capture and analysis of Unix Domain Socket through tcpdump

Original text: https://plantegg.github.io/2018/01/01/Capture and analyze Unix Socket packets through tcpdump/ Background introduction Most of the time we can use tcpdump to capture network packets and analyze request and response data to troubleshoot problems. However, if the program is accessed through Unix Domain Socket, then tcpdump cannot see the specific content flowing in the Unix Domain […]

Solve ERROR oslo_messaging.rpc.server UnixHTTPConnectionPool(host=localhost, port=None) Read timed out

zun.common.exception.ZunException: Unexpected error: UnixHTTPConnectionPool(host=localhost’, port=None): Read timed out. (read timeout=60) 2023-09-13 17:26:08.649 8468 ERROR oslo_messaging.rpc.server [req-6ff62c08-fd25-4df6-8a81-d144956cbbd9 7db25ffff6314194822f5ada52569de5 ce76b778ff0b 453aa7b486f9934f694e default – -] Exception during message handling: zun.common.exception.ZunException: Unexpected error : UnixHTTPConnectionPool(host=’localhost’, port=None): Read timed out. (read timeout=60) 2023-09-13 17:26:08.649 8468 ERROR oslo_messaging.rpc.server Traceback (most recent call last): 2023-09-13 17:26:08.649 8468 ERROR oslo_messaging.rpc.server File “/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py”, line […]

UNIX Advanced Programming [In-depth explanation] Advanced I/O

Table of Contents Non-blocking IO: How to make a file non-blocking IO multiplexing: Simple sample code (select) Simple sample code (poll) Simple example code (epoll) Memory-mapped Files: Finite state machine?Edit Implement interaction between “/dev/tty11” and “/dev/tty12” files (character device file Ctrl + alt + f11) select implementation (main changes) poll implementation (main changed) Advanced I/O: […]

unix multi-process multi-threading

Summary Threads and processes are two different concurrent execution units. They can both implement multi-task execution, but they have their own characteristics and differences. Thread is the basic unit of independent scheduling and execution of the operating system. It is an integral part of the process. A process can contain multiple threads, which share the […]