TCP stream peer. This object can be used to connect to TCP servers, or also is returned by a TCP server.
</description>
<tutorials>
</tutorials>
<methods>
<methodname="connect_to_host">
<returntype="int"enum="Error"/>
<argumentindex="0"name="host"type="String"/>
<argumentindex="1"name="port"type="int"/>
<description>
Connects to the specified [code]host:port[/code] pair. A hostname will be resolved if valid. Returns [constant OK] on success or [constant FAILED] on failure.
Returns [code]true[/code] if this peer is currently connected or is connecting to a host, [code]false[/code] otherwise.
</description>
</method>
<methodname="set_no_delay">
<returntype="void"/>
<argumentindex="0"name="enabled"type="bool"/>
<description>
If [code]enabled[/code] is [code]true[/code], packets will be sent immediately. If [code]enabled[/code] is [code]false[/code] (the default), packet transfers will be delayed and combined using [url=https://en.wikipedia.org/wiki/Nagle%27s_algorithm]Nagle's algorithm[/url].
[b]Note:[/b] It's recommended to leave this disabled for applications that send large packets or need to transfer a lot of data, as enabling this can decrease the total available bandwidth.