Provides network support
TCPSecureSocketServer
Secure TCP/IP Server socket
Operations
Accept #
Accepts a client connection
method : public : Accept() ~ TCPSecureSocketReturn
| Type | Description |
|---|---|
| TCPSecureSocket | client socket interface |
GetIssuer #
Gets the X.509 certificate's issuer name
method : public : GetIssuer() ~ StringReturn
| Type | Description |
|---|---|
| String | certificate issuer name |
GetLastError # function
Gets the calling thread's last TLS failure, from a connect, listen, accept, read or write; each of those replaces it, and one that works leaves none. A connect that failed says why the system refused it, e.g. "NET - The connection to the given server / port failed: Connection refused". A certificate that failed verification is described with each reason mbedTLS gives, e.g. "X509 - Certificate verification failed, e.g. CRL, CA or signature check failed: The certificate is not correctly signed by the trusted CA".
function : GetLastError() ~ StringReturn
| Type | Description |
|---|---|
| String | last error message, or Nil if there was none |
GetPort #
Gets the port this server is bound to: the port given to New, or, for a port of 0, the one the system chose when Listen() bound the socket, so a program needs no fixed port number. Before Listen() it is the port given.
method : public : GetPort() ~ IntReturn
| Type | Description |
|---|---|
| Int | bound port |
GetSubject #
Gets the X.509 certificate subject name
method : public : GetSubject() ~ StringReturn
| Type | Description |
|---|---|
| String | certificate subject name |
Listen #
Listens for incoming client connections
method : public : Listen() ~ BoolReturn
| Type | Description |
|---|---|
| Bool | true if client successfully connects, false otherwise |
New # constructor
Default constructor
New(cert:String, key:String, passwd:String, port:Int)Parameters
| Name | Type | Description |
|---|---|---|
| cert | String | path to ssl cert |
| key | String | path to ssl key |
| passwd | String | private key password |
| port | Int | server port |
New # constructor
Constructor that binds one local address instead of every interface. The address is read as by TCPSocketServer->New(address, port): a literal such as "127.0.0.1" or "::1", or a host name, of which the first IPv4 address (else the first IPv6 one) is bound; an empty or Nil address binds every interface. A bad address makes Listen() return false.
New(cert:String, key:String, passwd:String, address:String, port:Int)Parameters
| Name | Type | Description |
|---|---|---|
| cert | String | path to ssl cert |
| key | String | path to ssl key |
| passwd | String | private key password |
| address | String | local address to bind |
| port | Int | server port |