#!/usr/bin/python3
# coding:utf-8
import os
import socket
from http import HTTPStatus
import struct
import logging
from time import sleep
pa, pb = socket.socketpair()
pid = os.fork()
from socketserver import BaseRequestHandler, _SocketWriter
from werkzeug.serving import WSGIRequestHandler
def cpfd(fd):
msg = [b'x']
# 辅助数据,携带描述符
ancdata = [(
socket.SOL_SOCKET,
socket.SCM_RIGHTS,
struct.pack('i', fd.fileno()))]
print('front send fd',msg, ancdata)
s = pb.sendmsg(msg, ancdata)
class IWSGIRequestHandler(WSGIRequestHandler):
def
【代码】flask通过uds传输socket描述符实践
最新推荐文章于 2024-04-07 20:06:55 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)