Class StreamPeerTls
- Namespace
- Godot
- Assembly
- GodotSharp.dll
A stream peer that handles TLS connections. This object can be used to connect to a TLS server or accept a single TLS client connection.
Note: When exporting to Android, make sure to enable the INTERNET
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.
[GodotClassName("StreamPeerTLS")]
public class StreamPeerTls : StreamPeer, IDisposable
- Inheritance
-
StreamPeerTls
- Implements
- Inherited Members
Constructors
StreamPeerTls()
public StreamPeerTls()
Methods
AcceptStream(StreamPeer, TlsOptions)
Accepts a peer connection as a server using the given serverOptions
. See Server(CryptoKey, X509Certificate).
public Error AcceptStream(StreamPeer stream, TlsOptions serverOptions)
Parameters
stream
StreamPeerserverOptions
TlsOptions
Returns
ConnectToStream(StreamPeer, string, TlsOptions)
Connects to a peer using an underlying StreamPeerstream
and verifying the remote certificate is correctly signed for the given commonName
. You can pass the optional clientOptions
parameter to customize the trusted certification authorities, or disable the common name verification. See Client(X509Certificate, string) and ClientUnsafe(X509Certificate).
public Error ConnectToStream(StreamPeer stream, string commonName, TlsOptions clientOptions = null)
Parameters
stream
StreamPeercommonName
stringclientOptions
TlsOptions
Returns
DisconnectFromStream()
Disconnects from host.
public void DisconnectFromStream()
GetStatus()
Returns the status of the connection. See StreamPeerTls.Status for values.
public StreamPeerTls.Status GetStatus()
Returns
GetStream()
Returns the underlying StreamPeer connection, used in AcceptStream(StreamPeer, TlsOptions) or ConnectToStream(StreamPeer, string, TlsOptions).
public StreamPeer GetStream()
Returns
HasGodotClassMethod(in godot_string_name)
Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.
protected override bool HasGodotClassMethod(in godot_string_name method)
Parameters
method
godot_string_nameName of the method to check for.
Returns
HasGodotClassSignal(in godot_string_name)
Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.
protected override bool HasGodotClassSignal(in godot_string_name signal)
Parameters
signal
godot_string_nameName of the signal to check for.
Returns
InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)
Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.
protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)
Parameters
method
godot_string_nameName of the method to invoke.
args
NativeVariantPtrArgsArguments to use with the invoked method.
ret
godot_variantValue returned by the invoked method.
Returns
Poll()
Poll the connection to check for incoming bytes. Call this right before GetAvailableBytes() for it to work properly.
public void Poll()