6.105. kink/tls/TLS¶
6.105.1. type tls¶
An either end of a TLS connection.
6.105.1.1. Tls.tcp¶
`tcp` returns a `tcp` val as the TCP connecting socket backing the TLS connection.
6.105.1.2. Tls.input(...[$config={}])¶
inputメソッドはTLSコネクションのinputを戻す。
コンフィグメソッド:
• C.buffer(...[Max_buf_size])
C.bufferが呼ばれた場合、結果のinputはユーザ空間でのバッファリングを行う。Max_buf_sizeが渡された場合、バッファサイズはバイト長でMax_buf_sizeを超えない。C.bufferが呼ばれない場合、結果のinputはユーザ空間でのバッファリングを行わない。
結果のinputにcloseが呼ばれたときは、TLSコネクションが閉じられる。これは、TLSに入力だけを閉じる機能がないためである。
事前条件
TLSコネクションは開いていなければならない。
Max_buf_sizeは正の整数のnum値でなければならない。
6.105.1.3. Tls.output(...[$config={}])¶
outputメソッドはTLSコネクションのoutputを戻す。
コンフィグメソッド:
• C.buffer(...[Max_buf_size])
C.bufferが呼ばれた場合、結果のoutputはユーザ空間でのバッファリングを行う。Max_buf_sizeが渡された場合、バッファサイズはバイト長でMax_buf_sizeを超えない。C.bufferが呼ばれない場合、結果のoutputはユーザ空間でのバッファリングを行わない。
結果のoutputにcloseが呼ばれたときは、TLSコネクションが閉じられる。これは、TLSに出力だけを閉じる機能がないためである。
事前条件
TLSコネクションは開いていなければならない。
Max_buf_sizeは正の整数のnum値でなければならない。
6.105.1.4. Tls.close(...[$config={}])¶
`close` closes the TLS connection.
Config methods:
• C.on_success($success): default = {}
• C.on_error($error): default = {(:Exc) Exc.raise }
If the TLS connection is successfully closed, `close` tail-calls $success with no argument.
If an IO error occurs, `close` tail-calls $error with an `exception`.
When the TLS connection is already closed, calling this method does nothing.
Note that the backing TCP connection is NOT closed by this method.
事前条件
• $success must be a fun which takes no arg
• $error must be a fun which takes an `exception`
6.105.2. TLS.is?(Val)¶
`is?` returns whether `Val` is a val of `tls` type.