MbedTLS.jl
MbedTLS.jl copied to clipboard
ERROR: MbedTLS.SSLContext does not support byte I/O
Can you support this? The ordinary socket could be read by readuntil and 'readline' funtions.
julia> readline(c)
ERROR: MbedTLS.SSLContext does not support byte I/O
Stacktrace:
[1] error(::Type, ::String) at ./error.jl:42
[2] read(::MbedTLS.SSLContext, ::Type{UInt8}) at ./io.jl:182
[3] #readuntil#290 at ./io.jl:653 [inlined]
[4] #readuntil at ./none:0 [inlined]
[5] #readline#284(::Bool, ::Function, ::MbedTLS.SSLContext) at ./io.jl:370
[6] readline(::MbedTLS.SSLContext) at ./io.jl:370
[7] top-level scope at none:0
My feeling is that supporting one-byte-at-a-time IO, and thereby allowing use of readuntil, readline, etc would encourage inefficient code because one-byte-at-a-time loop inside readuntil would call all the way down into the TLS library.
Better to use a buffering wrapper like https://github.com/BioJulia/BufferedStreams.jl
@samoconnor ,Thanks you, I used IOBuffer finally.