Transport Factories

Transports are created by transport factories in one of two ways:

  • Dialling a destination
  • Listening for a dial from a destination

Sample interface:

struct TransportFactory {
    // Set source address
    void bind(SocketAddress &addr);

    // Start listening for incoming dials
    void listen();

    // Dial destination address
    void dial(SocketAddress &addr);
};

Higher-order transport factories

Higher-order transport factories complement higher-order transports by wrapping a base transport factory. For example, StreamTransportFactory produces stream transports by wrapping around a base factory which produces datagram transports.