Provides network support
DTLSSocketServer
DTLS/UDP secure server socket
Operations
Accept #
Accepts a client connection
method : public : Accept() ~ DTLSSocketReturn
| Type | Description |
|---|---|
| DTLSSocket | 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 DTLS 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, and a certificate that failed verification is described with each reason mbedTLS gives.
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. Every listener the server binds after an accept takes this same port.
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. The server keeps to that address after each client it accepts. 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 |