StreamPeerTls
A stream peer that handles TLS connections.
A stream peer that handles TLS connections.
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 remote deploy. Otherwise, network communication of any kind will be blocked by Android.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
StreamPeerTlsConstructor
public StreamPeerTls();Methods6
AcceptStreamError
public Error AcceptStream(StreamPeer stream, TlsOptions serverOptions);Accepts a peer connection as a server using the given server_options. See TlsOptions.Server.
| Name | Type | Default |
|---|---|---|
stream | StreamPeer | — |
serverOptions | TlsOptions | — |
ErrorConnectToStreamError
public Error ConnectToStream(StreamPeer stream, string commonName, TlsOptions clientOptions = null);Connects to a peer using an underlying StreamPeer stream and verifying the remote certificate is correctly signed for the given common_name. You can pass the optional client_options parameter to customize the trusted certification authorities, or disable the common name verification. See TlsOptions.Client and TlsOptions.ClientUnsafe.
| Name | Type | Default |
|---|---|---|
stream | StreamPeer | — |
commonName | string | — |
clientOptions | TlsOptions | null |
ErrorDisconnectFromStreamvoid
public void DisconnectFromStream();Disconnects from host.
GetStatusStreamPeerTls.Status
public StreamPeerTls.Status GetStatus();Returns the status of the connection.
StreamPeerTls.StatusGetStreamStreamPeer
public StreamPeer GetStream();Returns the underlying StreamPeer connection, used in StreamPeerTls.AcceptStream or StreamPeerTls.ConnectToStream.
StreamPeerPollvoid
public void Poll();Poll the connection to check for incoming bytes. Call this right before StreamPeer.GetAvailableBytes for it to work properly.
StreamPeerTls.Status
| Value | Description |
|---|---|
Connected = 2 | A status representing a |
Disconnected = 0 | A status representing a |
Error = 3 | A status representing a |
ErrorHostnameMismatch = 4 | An error status that shows a mismatch in the TLS certificate domain presented by the host and the domain requested for validation. |
Handshaking = 1 | A status representing a |