Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

UDSServer

继承: SocketServer < RefCounted < Object

Unix 域套接字(UDS)服务器。

描述

Unix 域套接字(UDS)服务器。监听套接字路径上的连接,并在收到传入连接时返回 StreamPeerUDS。Unix 域套接字使用文件系统命名空间在同一台机器上提供进程间通信。

注意:Unix 域套接字仅在类 Unix 系统(Linux、macOS 等)上可用,Windows 系统上不受支持。

方法

Error

listen(path: String)

StreamPeerUDS

take_connection()


方法说明

Error listen(path: String) 🔗

监听 path 处的套接字。套接字文件将在指定路径创建。

注意:指定路径下不能已存在套接字文件。调用该方法之前,可能需要删除任何已有的套接字文件。


StreamPeerUDS take_connection() 🔗

如果连接可用,则返回带有该连接的 StreamPeerUDS。