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

Some issues understanding tcp example #94

Open
S3j5b0 opened this issue Mar 4, 2022 · 1 comment
Open

Some issues understanding tcp example #94

S3j5b0 opened this issue Mar 4, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@S3j5b0
Copy link

S3j5b0 commented Mar 4, 2022

Hi, this might not be soi much of an issue, but maybe more a problem of understanding.
A little context first. I'm doing a project, where we should have an implementation of a specific protocol, that uses session types for the communication of two devices, on a network.

So, as a consequence of this, I was interested in looking at the tcp/client/server example of this page. Other session types repo's that I have been looking at have'nt had examples where session types was actually used by two processes acting away from each other.
And I had a hard time conceptually understanding how session types would work over a connection, since the definition of parties could not be in the same file, since the endpoints are usually run together by using fork_mpst

So I was thrilled to see your tcp example, in the example/tcp_and_others folder. And I have now studied it for a bit.

But it seems to me like the files in that folder does'nt actually use the session type specified in this library. The other examples in this repo follows the structure described in the README of the repo, defining roles and sending and receiving function with use mpstthree, but in the tcp example, another library called crossbeam_channel, which seems to be a more general.

So, is it possible to use the session types that this library uses over a connection? or maybe i'm completely misunderstanding the examples given

@NicolasLagaillardie
Copy link
Owner

Hi, the TCP and UDP features are not complete yet and I will not work on them in the near future.

The current TCP example works in two files: TCP server and TCP client. Currently, the basic protocol is hard coded in both files: the client connects to the server, then send a random message before receiving the same one appended after a "Reply is ok!: ", if everything goes right, and "Unexpected reply: " else.

If I actually used session types for this protocol, the two entities should first agree on the protocol to use, and then, they should closely follow it. The agreement of protocol can either be decided via hard coding before the communication, such as "if I use this port, it means that I will use this protocol", or agreed during handshake, but this implies that there is already a hard coded agreement protocol.

@NicolasLagaillardie NicolasLagaillardie added the enhancement New feature or request label Mar 14, 2022
@NicolasLagaillardie NicolasLagaillardie self-assigned this Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants