Neodriver_eio.TransportEio-based TCP transport with Bolt message framing.
Eio-based TCP transport with Bolt message framing.
See transport.ml for the implementation.
type tls_mode = | Plain| Verify of string| Trust_all of stringHow the connection is secured with TLS:
Plain: no TLS.Verify host: wrap the connection in TLS, validating the server certificate against the system trust store and checking host (bolt+s).Trust_all host: wrap the connection in TLS without validating the server certificate (bolt+ssc).val connect :
[> `Network | `Platform of [> `Generic ] ] Eio.Resource.t ->
Eio.Switch.t ->
?timeout:Eio.Time.Timeout.t ->
?tls:tls_mode ->
Neodriver_core.Addressing.t ->
(t, Neodriver_core.Errors.t) Stdlib.resultOpen a TCP connection to address (resolving host names as needed) and return a transport. Each resolved address (IPv4 and IPv6) is tried in turn until one connects. If tls is Verify _ or Trust_all _, the connection is wrapped in TLS before returning. The TCP connect and TLS handshake share a single timeout deadline; reads/writes on the result are bounded by the same deadline. The default (Eio.Time.Timeout.none) imposes no deadline.
val read_exact :
t ->
Stdlib.Bytes.t ->
int ->
int ->
(unit, Neodriver_core.Errors.t) Stdlib.resultRead exactly len bytes into buf starting at offset off.
val write :
t ->
Stdlib.Bytes.t ->
(unit, Neodriver_core.Errors.t) Stdlib.resultWrite buf to the connection.
val write_message :
t ->
Stdlib.Bytes.t ->
(unit, Neodriver_core.Errors.t) Stdlib.resultWrite a Bolt message, splitting it into 16 KiB chunks prefixed by their size and terminated by a 0x0000 chunk.
val read_message : t -> (Stdlib.Bytes.t, Neodriver_core.Errors.t) Stdlib.resultRead one Bolt message, reassembling its chunks and skipping NOOP (empty) messages.
val close : t -> unitClose the connection.