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

File Transfer #3

Open
stoiandan opened this issue Dec 21, 2023 · 3 comments
Open

File Transfer #3

stoiandan opened this issue Dec 21, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@stoiandan
Copy link
Owner

Howdy could be used to transfer files between instances. All that is need is some additional meta-data, probably in the header, though it could be encoded even in the existing UInt, but let's not be too frugal.
The new meta-data should be a bool saying "Do we do a file transfer now?", and if so the data with its already present size, should be treated like a file and saved somewhere, as opposed to a hostname message.

@stoiandan stoiandan added the enhancement New feature or request label Dec 21, 2023
@stoiandan
Copy link
Owner Author

@N3v1 if you want to work with me in this ^^ let me know.

@N3v1
Copy link
Contributor

N3v1 commented Dec 21, 2023

Sure - What needs to be done? Can you provide me with any resources about this topic I can read?

@stoiandan
Copy link
Owner Author

Well, there's the UI part and there's the networking part.
From the networking part, we need to extend the HowdyMessageHeader struct to include a bool, I think. This should tell is if the incoming message is a hostname message, were all you get is a string of a hostname to list it.
On the other hand, if the bool (say isFileTransfer, but maybe an enum Operation with two cases hostName and fileTransfer is a better idea) is coming set to true then we treat the incoming bytes (Data) as a file, no a string.

We can then check for this bool or enum in HowdyProtocol class' handleInput, this is were we are called by Network.framework every time we receive some bytes (the buffer) in order to form them into a higher order message (this is our protocol, the heart of it).

So HowdyProtocol's handleInput and handleOutput are the low-level methods that form the message for the higher-level receiveMessage and send .
So it's in the higher-level send were would decide what message to send, and the in handleInput to repare it for receiveMessage

Does that make sense?

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