pub(crate) async fn create_client(
__arg0: State<Arc<InternalState>>,
__arg1: Path<IpProtocol>,
__arg2: Json<SessionClientRequest>,
) -> Result<impl IntoResponse, impl IntoResponse>Expand description
Creates a new client session returning the given session listening host and port over TCP or UDP. If no listening port is given in the request, the socket will be bound to a random free port and returned in the response. Different capabilities can be configured for the session, such as data segmentation or retransmission.
Once the host and port are bound, it is possible to use the socket for bidirectional read/write communication over the selected IP protocol and HOPR network routing with the given destination. The destination HOPR node forwards all the data to the given target over the selected IP protocol.
Various services require different types of socket communications:
- services running over UDP usually do not require data retransmission, as it is already expected that UDP does not provide these and is therefore handled at the application layer.
- On the contrary, services running over TCP almost always expect data segmentation and retransmission capabilities, so these should be configured while creating a session that passes TCP data.