-
Notifications
You must be signed in to change notification settings - Fork 20
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
Seperate I/O from Telnet Parsing & Formatting #15
Comments
Great suggestion! I agree that it would be better to separate I/O out of the implementation. I will take a look at your code in a few days, and then we can discuss how we proceed. |
Hi @JamesStewy, sorry for my late reply. Last time I was in a long vacation (Chinese New Year), so I was not able to process this in time. I read though your code, and I think it is quite promising. This change definitely makes this lib more flexible to use. The only thing we may need to do is to add some test cases and docs for it. Maybe we can start from opening a pull request and iteratively adding other stuffs? How do you think? |
No worries, I hope you enjoyed your break. Currently there are quite a few options for the functionality that the final lib could provide. I was thinking if we can get an initial direction on some of these I can then rewrite what I have done in a clearer way (separating the new code into files, removing redundant existing code, etc.). I can then submit that as the PR and we can refine it from there. Below is a list of a few of the key decisions I can think of:
I will also write docs and tests but I was thinking of leaving that until we have a better idea on what the final lib looks like. |
Hi, thank you for your understanding. Here are my thoughts:
If you are ok with these, we can start from making a check list and open a branch for maintaining the new implementation. |
Similar to #14, I would like to use this package with tokio to read and write to a telnet stream asynchronously.
I was going to offer a tokio implementation for this library, but realised that doing so, while also providing the existing or similar synchronous implementation, would require either extensive reworking or a parallel implementation due to the
Read
&Write
traits of each system being incompatible. That is on top of the fact that in rust there are a large number of ways to read and write data such as blocking, non-blocking, futures, tokio, mio, etc. Telnet is an application layer protocol so the implementation of the underlying stream shouldn't matter.So my suggestion is to provide an API in this package that simply parses incoming telenet data into events, and formats outgoing data, by passing buffers rather than reading or writing to the underlying stream. That way the application can use its own method for reading and writing.
From there we could:
I have made a rough implementation of the suggested API as well as a synchronous reader and writer here to get an idea of what I am proposing.
Is this something you would be interested in pursuing?
The text was updated successfully, but these errors were encountered: