Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Inuit_base.SocketSourceA message Socket.controller is a bidirectional stream of message. The creator of a value of this type can:
message is received,make ~receive creates a new controller that will call receive when a message is received.
set_receive sets the callback invoked when a message is received.
set_on_closed sets the callback invoked when the connection terminates. Closing is definitive (it can happen at most once).
set_on_closed sets the callback invoked when the connection terminates. Closing is definitive (it can happen at most once).
set_on_connected sets the callback invoked when the connection is established. It can be invoked at most once.
set_on_connected sets the callback invoked when the connection is established. It can be invoked at most once.
send ctrl msg sends one message to the other end. status (endpoint ctrl) should be `Connected for this to succeed. Fail with Invalid_argument otherwise.
close ctrl terminates the connection now. If status (endpoint ctrl) is `Pending or `Connected, it is updated to `Closed and on_closed callback is invoked. If status (endpoint ctrl) is already `Closed, nothing happens.
A handle exposed to higher-level code to connect sockets together.
Get the status of the socket. Possible statuses are:
`Pending, connection has not been established yet, no message should be sent yet.`Connected, connection has been established, messages can be sent.`Closed, connection is terminated, no messages can be sent anymore.