Open stoiandan opened 6 months ago
@N3v1 if you want to work with me in this ^^ let me know.
Sure - What needs to be done? Can you provide me with any resources about this topic I can read?
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?
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 abool
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 ahostname
message.