klyn.net.ssl.SSLSocket.receive
method

    public receive(maxBytes as Int = 4096) as String throws SSLException:

Description

Receives up to `maxBytes` bytes interpreted as text.

Parameters

Parameter | Description
--- | ---
`maxBytes` | Maximum number of bytes to read.

Returns

Received text.

Throws

- SSLException if the TLS socket is not connected/configured correctly or a TLS transport operation fails.

Example

    import klyn.net.ssl

    socket = SSLSocket("example.com", 443)
    print(socket.receive(512))
    socket.close()