This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
UnigineEditor
界面概述
资产工作流程
设置和首选项
项目开发
调整节点参数
Setting Up Materials
Setting Up Properties
照明
Landscape Tool
Sandworm (Experimental)
使用编辑器工具执行特定任务
Extending Editor Functionality
嵌入式节点类型
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Objects
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine.Plugins.SSLSocket Class

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.

SSLSocket Class

Enums

X509_NAME_TYPE#

NameDescription
CERT_COMMON_NAME = Server name protected by a self-signed certificate.
CERT_ORGANIZATION = Name of the organization protected by a self-signed certificate.
CA_CERT_COMMON_NAME = Server name protected by a server certificate issued by the Certification Agency.
CA_CERT_ORGANIZATION = Name of the organization for which the SSL certificate is issued by the Certification Agency.

LOADER_TYPE#

NameDescription
RSA_KEY = RSA key.
X509_CERT = Self-signed X.509 certificate.
X509_CACERT = X.509 certificate issued by a Certification Agency.

Members


int open ( int port ) #

Opens the socket on a given port. When the socket receives data, packets from all network interfaces will be received. When the socket sends data, the default IP address will be used.

Arguments

  • int port - Port number, on which the socket will be opened.

Return value

1 if the socket is opened successfully; otherwise, 0.

int open ( string host, int port ) #

Opens the socket on a given port. When the socket receives data, packets from all network interfaces will be received. When the socket sends data, the default IP address will be used.

Arguments

  • string host - Host name, on which the socket will be opened.
  • int port - Port number, on which the socket will be opened.

Return value

1 if the socket is opened successfully; otherwise, 0.

int close ( ) #

Closes the socket.

Return value

1 if the socket is closed successfully; otherwise, 0.

int bind ( ) #

Binds the socket to an address figured out from the host used for socket initialization.

Return value

1 if the address is bound; otherwise, 0.

int listen ( int num ) #

Makes the socket listen to connections.

Arguments

  • int num - Maximum number of pending connections.

Return value

1 if the socket has started listening; otherwise, 0.

int accept ( SSLSocket socket ) #

Accepts a connection on the socket.

Arguments

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

Return value

1 if the connection is accepted; otherwise, 0.

int connect ( ) #

Initiates a connection on the socket.

Return value

1 if the connection is initialized; otherwise, 0.

int nonblock ( ) #

Makes the socket a non-blocking one.

Return value

1 if the socket has become non-blocking; otherwise, 0.

int block ( ) #

Sets up a blocking socket.

Return value

1 if the socket is opened; otherwise, 0.

int load ( SSLSocket.LOADER_TYPE type, string name, string password ) #

Loads a certificate from the file.

Arguments

Return value

1 if the certificate is loaded successfully, otherwise 0.

int parse ( SSLSocket.LOADER_TYPE type, string source, string password ) #

Parses a specified certificate.

Arguments

Return value

1 if the certificate is loaded successfully, otherwise 0.

int getHandshake ( ) #

Checks if the handshake is successful.

Return value

1 if the handshake is successful, otherwise 0.

string getInfo ( SSLSocket.X509_NAME_TYPE info ) #

Returns information about the certificate: organization or host name, depending on the argument.

Arguments

Return value

Information about the certificate issuer.

string getHost ( ) #

Returns the socket address.

Return value

Host name

int getPort ( ) #

Returns the port number of the socket.

Return value

Port number

int isOpened ( ) #

Checks if the socket has been opened.

Return value

1 if the socket is opened; otherwise, 0.

int isAvailable ( ) #

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

Return value

1 if the socket is available; otherwise, 0.

Stream getStream ( ) #

Returns a stream to read or write data via SSL.

Return value

Stream to read or write data via SSL.
Last update: 2020-11-24
Build: ()