pub fn startup<S>(
spawn: S,
socket: Socket
) -> (PackageSender, PackageReceiver, ConnErrorReceiver)
Expand description
Setups and starts communication stack tasks and returns communication channels for data sending, data retrieval, and error retrieval.
All tasks in the network stack keep running until the returned channels are
closed. Once the PackageSender
, PackageReceiver
, and
ConnErrorReceiver
are all dropped, the networking stack will terminate
completely.
§Arguments
-
spawn
- async task spawner. -
socket
- network communication will happen over this socket.