Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propose Session trait and remove all the logic below the application-layer #20

Closed
wants to merge 10 commits into from

Conversation

keisrk
Copy link
Contributor

@keisrk keisrk commented Jan 7, 2021

Although it looks pedantic I propose a session trait encapsulating network
transaction in general. One downside of the TcpClient trait is that it only
allows a single socket type. The Session trait is meant to be implemented by
multiple transaction types and they can share the same driver type of
TcpClient.

MQTT is defined on top of the applicaiton-layer and all that it requires is an
active session. We can simplify the logic by assuming a user has performed
connection to a broker in advance and supplies the session only.

It is nice and kind of the rumqtt client implementation where it takes care of
all the TLS connection building, like CA and certs. However it is only possible
because of tokio_tls and not the case for our embedded environment.

Kei Shirakizawa added 9 commits December 18, 2020 14:09
MQTT is defined on top of the applicaiton-layer and all that it requires is an
active session. We can simplify the logic by assuming a user has performed
connection to a broker in advance and supplies the session.

It is nice and kind of the `rumqtt` client implementation where it takes care of
all the TLS connection building, like CA and certs. However it is only possible
because of `tokio_tls` and not the case for embedded environment.
Although it look pedantic I propose a session trait encapsulating network
transaction in general. One downside of the `TcpClient` trait is that it only
allows a single socket type. On the other hand, the `Session` trait can be
implemented by multiple transaction types and they can share the same driver
type of `TcpClient`.
@keisrk keisrk changed the title Application layer only Propose Session trait and remove all the logic below the application-layer Jan 7, 2021
@keisrk keisrk changed the base branch from master to embedded-nal-v0.2.0 January 7, 2021 09:38
@MathiasKoch
Copy link
Member

I will get to reviewing this and your other PRs, but at the moment i have gotten STRICT orders from Finn, not to add ANY new code, until we have fully verified that the connection state handling is as good as it needs to be. Thus i am pushing the reviews until they are applicable.

They do look sound at first sight though. 👍

@keisrk
Copy link
Contributor Author

keisrk commented Jan 12, 2021

Fully understood. For the time being we should focus on testing existing code base. Thanks for your comment :)

Base automatically changed from embedded-nal-v0.2.0 to master January 22, 2021 07:52
@MathiasKoch MathiasKoch linked an issue Jan 27, 2021 that may be closed by this pull request
@MathiasKoch
Copy link
Member

@keisrk Could you rebase this, so i can test it out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TLS handling
2 participants