icon: octicons/gear-24 search: exclude: false categories: - engine - node tags: - transport-connection-engine - engine-definition
Juvix imports
module arch.node.net.transport_connection;
import arch.node.net.transport_connection_messages open;
import arch.node.net.transport_connection_config open;
import arch.node.net.transport_connection_environment open;
import arch.node.net.transport_connection_behaviour open;
import arch.node.types.basics open;
import arch.node.types.engine open;
import arch.node.types.anoma as Anoma open;
open transport_connection_config_example;
open transport_connection_environment_example;
open transport_connection_behaviour_example;
Transport Connection Engine¶
Purpose¶
A Transport Protocol engine is responsible for accepting and initiating transport connections for one specific transport protocol, such as QUIC or TLS.
Engine Components¶
- Transport Connection Messages
- Transport Connection Configuration
- Transport Connection Environment
- Transport Connection Behaviour
Type¶
TransportConnectionEngine : Type :=
Engine
TransportConnectionLocalCfg
TransportConnectionLocalState
TransportConnectionMailboxState
TransportConnectionTimerHandle
TransportConnectionActionArguments
Anoma.Msg
Anoma.Cfg
Anoma.Env;
Instantiation¶
exTransportConnectionEngine : TransportConnectionEngine :=
mkEngine@{
cfg := exTransportConnectionCfg;
env := exTransportConnectionEnv;
behaviour := exTransportConnectionBehaviour;
};
Where exTransportConnectionCfg
is defined as follows:
exTransportConnectionCfg : TransportConnectionCfg :=
mkEngineCfg@{
node := Curve25519PubKey "0xabcd1234";
name := "transport-connection";
cfg := mkTransportConnectionLocalCfg;
};
exTransportConnectionEnv
is defined as follows:
exTransportConnectionEnv : TransportConnectionEnv :=
mkEngineEnv@{
localState := mkTransportConnectionLocalState;
mailboxCluster := Map.empty;
acquaintances := Set.empty;
timers := [];
};
and exTransportConnectionBehaviour
is defined as follows:
module transport_connection_behaviour_example;
exTransportConnectionBehaviour : TransportConnectionBehaviour :=
mkEngineBehaviour@{
guards := First [exampleReplyGuard];
};
end;