Provides minisql protocol connection facilities for this project.
Package: minisql.protocol.connection
Reachable from entry: yes
minisql/common/endian.mlasendian→ src/minisql/common/endian.mlminisql/common/uuid.mlasuuid→ src/minisql/common/uuid.mlminisql/platform/network.mlasnetwork→ src/minisql/platform/network.mlminisql/platform/tls_schannel.mlastls_schannel→ src/minisql/platform/tls_schannel.mlminisql/protocol/codec.mlascodec→ src/minisql/protocol/codec.mlminisql/protocol/constants.mlasconstants→ src/minisql/protocol/constants.mlminisql/protocol/messages.mlasmessages→ src/minisql/protocol/messages.ml
function abort(connection)Aborts a potentially desynchronized transport without sending TLS or protocol shutdown data.
| Parameter | Type | Default | Description |
|---|---|---|---|
connection |
dynamic |
— | connection value consumed by this operation. |
function appendReceiveBytes(connection, incoming)Appends plaintext obtained from Schannel while preserving the frame memory bound.
| Parameter | Type | Default | Description |
|---|---|---|---|
connection |
dynamic |
— | connection value consumed by this operation. |
incoming |
dynamic |
— | incoming value consumed by this operation. |
function appendReceiveScratch(connection, count)Appends receive scratch using the supplied inputs. Requires arguments that satisfy the validation performed below. Returns the computed value or operation status. May mutate supplied state and perform I/O through its dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
connection |
dynamic |
— | connection value consumed by this operation. |
count |
dynamic |
— | Number of items or units to process. |
function close(connection)Closes close owned by the minisql protocol connection module. Requires arguments that satisfy the validation performed below. Returns the computed value or operation status. May mutate supplied state and perform I/O through its dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
connection |
dynamic |
— | connection value consumed by this operation. |
const CLOSED_HANDLE = 9008Defines the closed handle constant used by the minisql protocol connection module.
function componentName()Performs the componentName operation for the minisql protocol connection module. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
function connectAddress(address, port)Connects address using the supplied inputs. Returns the computed value or operation status. Performs I/O through its file, transport, or storage dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
address |
dynamic |
— | address value consumed by this operation. |
port |
dynamic |
— | port value consumed by this operation. |
function connectLoopback(port)Connects loopback using the supplied inputs. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
port |
dynamic |
— | port value consumed by this operation. |
function connectTlsAddress(address, port, serverName)Connects a TCP socket and completes native TLS with Windows root-store trust.
| Parameter | Type | Default | Description |
|---|---|---|---|
address |
dynamic |
— | address value consumed by this operation. |
port |
dynamic |
— | port value consumed by this operation. |
serverName |
dynamic |
— | serverName value consumed by this operation. |
function connectTlsPinnedAddress(address, port, serverName, pinText)Connects native TLS using an exact SHA-256 leaf pin for private certificates.
| Parameter | Type | Default | Description |
|---|---|---|---|
address |
dynamic |
— | address value consumed by this operation. |
port |
dynamic |
— | port value consumed by this operation. |
serverName |
dynamic |
— | serverName value consumed by this operation. |
pinText |
dynamic |
— | pinText value consumed by this operation. |
function copyRange(source, offset, count, operation)Implements copy range for this module. Requires arguments that satisfy the validation performed below. Returns its result or propagates a structured error from validation or a dependency. Performs I/O through its file, transport, or storage dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
source |
dynamic |
— | source value consumed by this operation. |
offset |
dynamic |
— | Zero-based offset at which processing starts. |
count |
dynamic |
— | Number of items or units to process. |
operation |
dynamic |
— | operation value consumed by this operation. |
const CORRUPT_DATA = 9004Defines the corrupt data constant used by the minisql protocol connection module.
function create(socketHandle)Creates create for the minisql protocol connection module. Returns the computed value or operation status. Performs I/O through its file, transport, or storage dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
socketHandle |
dynamic |
— | socketHandle value consumed by this operation. |
function decodeInbound(connection, frame)Decodes inbound using the supplied inputs. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
connection |
dynamic |
— | connection value consumed by this operation. |
frame |
dynamic |
— | frame value consumed by this operation. |
function enableSecure(connection, sendKey, receiveKey)Implements enable secure for this module. Requires arguments that satisfy the validation performed below. Returns the computed value or operation status. May mutate supplied state and perform I/O through its dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
connection |
dynamic |
— | connection value consumed by this operation. |
sendKey |
dynamic |
— | sendKey value consumed by this operation. |
receiveKey |
dynamic |
— | receiveKey value consumed by this operation. |
function enableTls(connection, tlsContext)Attaches a completed Schannel context below the MiniSQL framed protocol.
| Parameter | Type | Default | Description |
|---|---|---|---|
connection |
dynamic |
— | connection value consumed by this operation. |
tlsContext |
dynamic |
— | tlsContext value consumed by this operation. |
function extractBufferedMessage(connection)Implements extract buffered message for this module. Requires arguments that satisfy the validation performed below. Returns its result or propagates a structured error from validation or a dependency. May mutate supplied state and perform I/O through its dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
connection |
dynamic |
— | connection value consumed by this operation. |
function fail(code, operation, message)Performs the fail operation for the minisql protocol connection module. Returns its result or propagates a structured error from validation or a dependency. Performs I/O through its file, transport, or storage dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
code |
dynamic |
— | code value consumed by this operation. |
operation |
dynamic |
— | operation value consumed by this operation. |
message |
dynamic |
— | Human-readable message associated with the operation. |
const INVALID_ARGUMENT = 9001Defines the invalid argument constant used by the minisql protocol connection module.
function isConnection(value)Returns whether the supplied value satisfies the connection condition. Returns the computed value or operation status. Does not modify its inputs.
| Parameter | Type | Default | Description |
|---|---|---|---|
value |
dynamic |
— | Value consumed or transformed by the operation. |
function isImplemented()Returns whether implemented satisfies the condition required by the minisql protocol connection module. Returns the computed value or operation status. Does not modify its inputs.
function isPollResult(value)Returns whether the supplied value satisfies the poll result condition. Returns the computed value or operation status. Does not modify its inputs.
| Parameter | Type | Default | Description |
|---|---|---|---|
value |
dynamic |
— | Value consumed or transformed by the operation. |
function makeNonBlocking(connection)Creates non blocking using the supplied inputs. Returns the computed value or operation status. Performs I/O through its file, transport, or storage dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
connection |
dynamic |
— | connection value consumed by this operation. |
const POLL_RECEIVE_BYTES = 65536Defines the poll receive bytes constant used by the minisql protocol connection module.
function pollMessage(connection)Attempts one nonblocking framed receive. Returns PollResult when a complete frame or clean EOF is available, void when more bytes are needed, or an error for malformed/truncated/transport input.
| Parameter | Type | Default | Description |
|---|---|---|---|
connection |
dynamic |
— | connection value consumed by this operation. |
function protectMessage(connection, message)Implements protect message for this module. Returns the computed value or operation status. May mutate supplied state and perform I/O through its dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
connection |
dynamic |
— | connection value consumed by this operation. |
message |
dynamic |
— | Human-readable message associated with the operation. |
function protocolBytesReceived(connection)Returns framed protocol bytes read by this connection.
| Parameter | Type | Default | Description |
|---|---|---|---|
connection |
dynamic |
— | connection value consumed by this operation. |
function protocolBytesSent(connection)Returns framed protocol bytes written by this connection. TLS record overhead is deliberately excluded so plain and protected protocol workloads compare.
| Parameter | Type | Default | Description |
|---|---|---|---|
connection |
dynamic |
— | connection value consumed by this operation. |
function receiveMessage(connection)Receives message using the supplied inputs. Returns the computed value or operation status. Performs I/O through its file, transport, or storage dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
connection |
dynamic |
— | connection value consumed by this operation. |
const SECURE_TRANSPORT = 9030Defines the secure transport constant used by the minisql protocol connection module.
function secureActive(connection)Implements secure active for this module. Returns the computed value or operation status. Performs I/O through its file, transport, or storage dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
connection |
dynamic |
— | connection value consumed by this operation. |
function sendMessage(connection, message)Sends message using the supplied inputs. Returns the computed value or operation status. Performs I/O through its file, transport, or storage dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
connection |
dynamic |
— | connection value consumed by this operation. |
message |
dynamic |
— | Human-readable message associated with the operation. |
function setTimeouts(connection, receiveMs, sendMs)Applies bounded socket I/O while a caller performs a protocol phase such as the initial HELLO exchange. Passing zero restores normal unbounded query I/O.
| Parameter | Type | Default | Description |
|---|---|---|---|
connection |
dynamic |
— | connection value consumed by this operation. |
receiveMs |
dynamic |
— | receiveMs value consumed by this operation. |
sendMs |
dynamic |
— | sendMs value consumed by this operation. |
function targetMilestone()Performs the targetMilestone operation for the minisql protocol connection module. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
function tlsActive(connection)Reports whether native TLS record protection is active.
| Parameter | Type | Default | Description |
|---|---|---|---|
connection |
dynamic |
— | connection value consumed by this operation. |
function unprotectMessage(connection, message)Implements unprotect message for this module. Requires arguments that satisfy the validation performed below. Returns its result or propagates a structured error from validation or a dependency. May mutate supplied state and perform I/O through its dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
connection |
dynamic |
— | connection value consumed by this operation. |
message |
dynamic |
— | Human-readable message associated with the operation. |
function validateOpen(connection, operation)Validates open for the minisql protocol connection workflow. Requires arguments that satisfy the validation performed below. Returns the computed value or operation status. Performs I/O through its file, transport, or storage dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
connection |
dynamic |
— | connection value consumed by this operation. |
operation |
dynamic |
— | operation value consumed by this operation. |