Skip to content

Latest commit

 

History

History
123 lines (87 loc) · 2.24 KB

contract_driver.md

File metadata and controls

123 lines (87 loc) · 2.24 KB

#Module contract_driver#

Generic protocol driver process for protocol sessions.

.

This module defines the contract_driver behaviour.

Required callback functions: start/1, start/2, init/1, init/2, encode/3, decode/5.

##Function Index##

behaviour_info/1
loop/5
loop/6
loop/7

Driver main loop.

  • A driver sits between a socket and a Pid

  • Stuff on the socket is send to the Pid

  • Stuff from the Pid is send to the socket

  • When it is called the Socket has been set to send messages to the driver and the Pid exists

  • If one side dies the process dies

.
relay/3
start/3

##Function Details##

###behaviour_info/1##

behaviour_info(Other) -> any()

###loop/5##

loop(Module, Contract, Options, Pid, Socket) -> any()

###loop/6##

loop(Module, Contract, Options, Pid, Socket, Timeout) -> any()

###loop/7##

loop(Module, Contract, Options, Pid, Socket, Timeout, Cont) -> any()

Driver main loop.

  • A driver sits between a socket and a Pid

  • Stuff on the socket is send to the Pid

  • Stuff from the Pid is send to the socket

  • When it is called the Socket has been set to send messages to the driver and the Pid exists

  • If one side dies the process dies

###relay/3##

relay(Module, Pid, Pid1) -> any()

###start/3##

start(Module, Contract, Options) -> any()