SSLSocket Class
UnigineScript is deprecated and will be removed in future releases. Please consider using C#/C++ instead, as these APIs are the preferred ones. Availability of new Engine features in UnigineScipt is not guaranteed, as the current level of support assumes only fixing critical issues.
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.
You should upgrade to
SSLSocket Class
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 ( int type, string name, string password ) #
Loads a certificate from the file.Arguments
- int type - Certificate type, one of the LOADER_TYPE values.
- string name - Certificate file name.
- string password - Certificate password.
Return value
1 if the certificate is loaded successfully, otherwise 0.int parse ( int type, string source, string password ) #
Parses a specified certificate.Arguments
- int type - Certificate type, one of the LOADER_TYPE values.
- string source - Certificate source.
- string password - Certificate password.
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 ( int info ) #
Returns information about the certificate: organization or host name, depending on the argument.Arguments
- int info - Type of information to be obtained, one of the X509_NAME_TYPE values.
Return value
Information about the certificate issuer.string getHost ( ) #
Returns the socket address.Return value
Host nameint getPort ( ) #
Returns the port number of the socket.Return value
Port numberint 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-04-10
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)