This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
Rendering
Professional (SIM)
UnigineEditor
Interface Overview
Assets Workflow
Version Control
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API
Animations-Related Classes
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
VR-Related Classes
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials

SSLSocket Class

Warning
The scope of applications for UnigineScript is limited to implementing materials-related logic (material expressions, scriptable materials, brush materials). Do not use UnigineScript as a language for application logic, please consider C#/C++ instead, as these APIs are the preferred ones. Availability of new Engine features in UnigineScript (beyond its scope of applications) is not guaranteed, as the current level of support assumes only fixing critical issues.
Warning
The functionality described in this article is not available in the Community SDK edition.
You should upgrade to Engineering / Sim SDK edition to use it.
Inherits from: Socket

SSLSocket Class

Members


SSLSocket ( ) #

Constructor. Creates a new SSL socket with default parameters (TLS).

SSLSocket ( int socket_type, int ssl_method ) #

Constructor. Creates a new SSL socket with the specified parameters.

Arguments

  • int socket_type - SSL socket type.
  • int ssl_method - SSL connection method to be used.

void close ( ) #

Closes the socket.

int accept ( Socket socket ) #

Accepts a connection on the socket.

Arguments

  • Socket socket - Socket that is bound to an address and listens to connections.

Return value

1 if the connection is accepted; otherwise, fals.

int connect ( ) #

Initiates a connection on the socket.

Return value

1 if the connection is initialized; otherwise, 0.

int load ( int loader_type, string path ) #

Loads a certificate from the file.

Arguments

  • int loader_type - Certificate type, one of the LOADER_TYPE values.
  • string path - Path to a certificate file.

Return value

1 if the certificate is loaded successfully, otherwise 0.

int parse ( int loader_type, string data ) #

Parses a specified certificate.

Arguments

  • int loader_type - Certificate type, one of the LOADER_TYPE values.
  • string data - Certificate data.

Return value

1 if the certificate is parsed successfully, otherwise 0.

int handshake ( ) #

Starts a handshake and returns the result.

Return value

Handshake status.

int isAvailable ( ) #

Checks if the socket has been established, but not opened.

Return value

1 if the socket is available; otherwise, 0.

int isCertificateVerified ( ) #

Returns a value indicating if SSL certificate for the socket is successfully verified.

Return value

1 if SSL certificate for the socket is successfully verified; otherwise, 0.

int pending ( ) #

Returns the number of bytes available for immediate retrieval without reading from the socket object. This function is essential if you work with event loops.

Return value

Number of bytes.

int read ( void * ptr, int size, int nmemb ) #

Reads the specified number of blocks of the specified size from the SSL connection to the specified destination buffer.

Arguments

  • void * ptr - Pointer to the destination buffer to which the data is to be read.
  • int size - Size of a message block in bytes.
  • int nmemb - Number of message blocks to read from the SSL connection.

Return value

Number of bytes actually read.

int write ( const void * ptr, int size, int nmemb ) #

Writes the specified number of blocks of the specified size from the specified source buffer to the SSL connection.

Arguments

  • const void * ptr - Pointer to the source buffer from which the data is to be written.
  • int size - Size of a message block in bytes.
  • int nmemb - Number of message blocks to be written to the SSL connection.

Return value

Number of bytes actually written.

int peek ( void * ptr, int size, int nmemb ) #

Reads the specified number of blocks of the specified size from the SSL connection to the specified destination buffer. This method is identical to read() except no bytes are actually removed from the underlying BIO during the read, so that a subsequent call to read() will yield at least the same bytes.

Arguments

  • void * ptr - Pointer to the destination buffer to which the data is to be read.
  • int size - Size of a message block in bytes.
  • int nmemb - Number of message blocks to be written to the SSL connection.

Return value

Number of bytes actually written.
Last update: 2023-11-30
Build: ()