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.

SocketServer

繼承: RefCounted < Object

被繼承: TCPServer, UDSServer

An abstract class for servers based on sockets.

說明

A socket server.

方法

bool

is_connection_available() const

bool

is_listening() const

void

stop()

StreamPeerSocket

take_socket_connection()


方法說明

bool is_connection_available() const 🔗

如果有連接可供獲取,則返回 true


bool is_listening() const 🔗

如果伺服器目前正在偵聽連接,則返回 true


void stop() 🔗

停止監聽。


StreamPeerSocket take_socket_connection() 🔗

If a connection is available, returns a StreamPeerSocket with the connection.