initial commit, 4.5 stable
Some checks failed
🔗 GHA / 📊 Static checks (push) Has been cancelled
🔗 GHA / 🤖 Android (push) Has been cancelled
🔗 GHA / 🍏 iOS (push) Has been cancelled
🔗 GHA / 🐧 Linux (push) Has been cancelled
🔗 GHA / 🍎 macOS (push) Has been cancelled
🔗 GHA / 🏁 Windows (push) Has been cancelled
🔗 GHA / 🌐 Web (push) Has been cancelled
Some checks failed
🔗 GHA / 📊 Static checks (push) Has been cancelled
🔗 GHA / 🤖 Android (push) Has been cancelled
🔗 GHA / 🍏 iOS (push) Has been cancelled
🔗 GHA / 🐧 Linux (push) Has been cancelled
🔗 GHA / 🍎 macOS (push) Has been cancelled
🔗 GHA / 🏁 Windows (push) Has been cancelled
🔗 GHA / 🌐 Web (push) Has been cancelled
This commit is contained in:
55
doc/classes/TCPServer.xml
Normal file
55
doc/classes/TCPServer.xml
Normal file
@@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="TCPServer" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
|
||||
<brief_description>
|
||||
A TCP server.
|
||||
</brief_description>
|
||||
<description>
|
||||
A TCP server. Listens to connections on a port and returns a [StreamPeerTCP] when it gets an incoming connection.
|
||||
[b]Note:[/b] When exporting to Android, make sure to enable the [code]INTERNET[/code] permission in the Android export preset before exporting the project or using one-click deploy. Otherwise, network communication of any kind will be blocked by Android.
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
<methods>
|
||||
<method name="get_local_port" qualifiers="const">
|
||||
<return type="int" />
|
||||
<description>
|
||||
Returns the local port this server is listening to.
|
||||
</description>
|
||||
</method>
|
||||
<method name="is_connection_available" qualifiers="const">
|
||||
<return type="bool" />
|
||||
<description>
|
||||
Returns [code]true[/code] if a connection is available for taking.
|
||||
</description>
|
||||
</method>
|
||||
<method name="is_listening" qualifiers="const">
|
||||
<return type="bool" />
|
||||
<description>
|
||||
Returns [code]true[/code] if the server is currently listening for connections.
|
||||
</description>
|
||||
</method>
|
||||
<method name="listen">
|
||||
<return type="int" enum="Error" />
|
||||
<param index="0" name="port" type="int" />
|
||||
<param index="1" name="bind_address" type="String" default=""*"" />
|
||||
<description>
|
||||
Listen on the [param port] binding to [param bind_address].
|
||||
If [param bind_address] is set as [code]"*"[/code] (default), the server will listen on all available addresses (both IPv4 and IPv6).
|
||||
If [param bind_address] is set as [code]"0.0.0.0"[/code] (for IPv4) or [code]"::"[/code] (for IPv6), the server will listen on all available addresses matching that IP type.
|
||||
If [param bind_address] is set to any valid address (e.g. [code]"192.168.1.101"[/code], [code]"::1"[/code], etc.), the server will only listen on the interface with that address (or fail if no interface with the given address exists).
|
||||
</description>
|
||||
</method>
|
||||
<method name="stop">
|
||||
<return type="void" />
|
||||
<description>
|
||||
Stops listening.
|
||||
</description>
|
||||
</method>
|
||||
<method name="take_connection">
|
||||
<return type="StreamPeerTCP" />
|
||||
<description>
|
||||
If a connection is available, returns a StreamPeerTCP with the connection.
|
||||
</description>
|
||||
</method>
|
||||
</methods>
|
||||
</class>
|
Reference in New Issue
Block a user